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

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

public class DefaultCacheFactory<K,V>
extends AbstractNamedCacheComponentFactory

Default implementation of the CacheFactory interface.

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

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

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
DefaultCacheFactory()
           
 
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

DefaultCacheFactory

public DefaultCacheFactory()
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
start - whether to start 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


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