org.infinispan.factories
Class InternalCacheFactory<K,V>

java.lang.Object
  extended by org.infinispan.factories.AbstractComponentFactory
      extended by org.infinispan.factories.AbstractNamedCacheComponentFactory
          extended by org.infinispan.factories.InternalCacheFactory<K,V>

public class InternalCacheFactory<K,V>
extends AbstractNamedCacheComponentFactory

An internal factory for constructing Caches. Used by the DefaultCacheManager, this is not intended as public API.

This is a special instance of a AbstractComponentFactory which contains bootstrap information for the ComponentRegistry.

Since:
4.0
Author:
Manik Surtani (manik@jboss.org)

Field Summary
 
Fields inherited from class org.infinispan.factories.AbstractNamedCacheComponentFactory
componentRegistry, configuration
 
Fields inherited from class org.infinispan.factories.AbstractComponentFactory
globalComponentRegistry, globalConfiguration, log
 
Constructor Summary
InternalCacheFactory()
           
 
Method Summary
<T> T
construct(Class<T> componentType)
          Constructs a component.
protected  AdvancedCache<K,V> createAndWire(Configuration configuration, GlobalComponentRegistry globalComponentRegistry, String cacheName)
           
 Cache<K,V> createCache(Configuration configuration, GlobalComponentRegistry globalComponentRegistry, String cacheName)
          This implementation clones the configuration passed in before using it.
 Cache<K,V> createDefaultCache(Configuration configuration)
           
 void setDefaultClassLoader(ClassLoader loader)
          Allows users to specify a default class loader to use for both the construction and running of the cache.
 
Methods inherited from class org.infinispan.factories.AbstractComponentFactory
assertTypeConstructable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternalCacheFactory

public InternalCacheFactory()
Method Detail

createCache

public Cache<K,V> createCache(Configuration configuration,
                              GlobalComponentRegistry globalComponentRegistry,
                              String cacheName)
                       throws ConfigurationException
This implementation clones the configuration passed in before using it.

Parameters:
configuration - to use
globalComponentRegistry - global component registry to attach the cache to
cacheName - name of the cache
Returns:
a cache
Throws:
ConfigurationException - if there are problems with the cfg

createDefaultCache

public Cache<K,V> createDefaultCache(Configuration configuration)
                              throws ConfigurationException
Throws:
ConfigurationException

createAndWire

protected AdvancedCache<K,V> createAndWire(Configuration configuration,
                                           GlobalComponentRegistry globalComponentRegistry,
                                           String cacheName)
                                    throws Exception
Throws:
Exception

setDefaultClassLoader

public void setDefaultClassLoader(ClassLoader loader)
Allows users to specify a default class loader to use for both the construction and running of the cache.

Parameters:
loader - class loader to use as a default.

construct

public <T> T construct(Class<T> componentType)
Description copied from class: AbstractComponentFactory
Constructs a component.

Specified by:
construct in class AbstractComponentFactory
Parameters:
componentType - type of component
Returns:
a component

Google Analytics

Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.