org.infinispan.manager
Class DefaultCacheManager

java.lang.Object
  extended by org.infinispan.manager.DefaultCacheManager
All Implemented Interfaces:
BasicCacheContainer, Lifecycle, CacheContainer, CacheManager, EmbeddedCacheManager, Listenable

public class DefaultCacheManager
extends Object
implements EmbeddedCacheManager, CacheManager

A CacheManager is the primary mechanism for retrieving a Cache instance, and is often used as a starting point to using the Cache.

CacheManagers are heavyweight objects, and we foresee no more than one CacheManager being used per JVM (unless specific configuration requirements require more than one; but either way, this would be a minimal and finite number of instances).

Constructing a CacheManager is done via one of its constructors, which optionally take in a Configuration or a path or URL to a configuration XML file.

Lifecycle - CacheManagers have a lifecycle (it implements Lifecycle) and the default constructors also call start(). Overloaded versions of the constructors are available, that do not start the CacheManager, although it must be kept in mind that CacheManagers need to be started before they can be used to create Cache instances.

Once constructed, CacheManagers should be made available to any component that requires a Cache, via JNDI or via some other mechanism such as an IoC container.

You obtain Cache instances from the CacheManager by using one of the overloaded getCache(), methods. Note that with getCache(), there is no guarantee that the instance you get is brand-new and empty, since caches are named and shared. Because of this, the CacheManager also acts as a repository of Caches, and is an effective mechanism of looking up or creating Caches on demand.

When the system shuts down, it should call stop() on the CacheManager. This will ensure all caches within its scope are properly stopped as well.

Sample usage: CacheManager manager = CacheManager.getInstance("my-config-file.xml"); Cache<String, Person> entityCache = manager.getCache("myEntityCache"); entityCache.put("aPerson", new Person()); ConfigurationBuilder confBuilder = new ConfigurationBuilder(); confBuilder.clustering().cacheMode(CacheMode.REPL_SYNC); manager.defineConfiguration("myReplicatedCache", confBuilder.build()); Cache<String, String> replicatedCache = manager.getCache("myReplicatedCache");

Since:
4.0
Author:
Manik Surtani, Galder ZamarreƱo

Field Summary
protected  Configuration defaultConfiguration
           
protected  GlobalConfiguration globalConfiguration
           
static String OBJECT_NAME
           
 
Fields inherited from interface org.infinispan.api.BasicCacheContainer
DEFAULT_CACHE_NAME
 
Constructor Summary
DefaultCacheManager()
          Constructs and starts a default instance of the CacheManager, using configuration defaults.
DefaultCacheManager(boolean start)
          Constructs a default instance of the CacheManager, using configuration defaults.
DefaultCacheManager(Configuration defaultConfiguration)
          Deprecated. Use DefaultCacheManager(org.infinispan.configuration.cache.Configuration) instead
DefaultCacheManager(Configuration defaultConfiguration)
          Constructs and starts a new instance of the CacheManager, using the default configuration passed in.
DefaultCacheManager(Configuration defaultConfiguration, boolean start)
          Deprecated. Use DefaultCacheManager(org.infinispan.configuration.cache.Configuration, boolean) instead
DefaultCacheManager(Configuration defaultConfiguration, boolean start)
          Constructs a new instance of the CacheManager, using the default configuration passed in.
DefaultCacheManager(ConfigurationBuilderHolder holder, boolean start)
          Constructs a new instance of the CacheManager, using the holder passed in to read configuration settings.
DefaultCacheManager(GlobalConfiguration globalConfiguration)
          Deprecated. Use DefaultCacheManager(org.infinispan.configuration.global.GlobalConfiguration) instead
DefaultCacheManager(GlobalConfiguration globalConfiguration)
          Constructs and starts a new instance of the CacheManager, using the global configuration passed in, and system defaults for the default named cache configuration.
DefaultCacheManager(GlobalConfiguration globalConfiguration, boolean start)
          Deprecated. Use DefaultCacheManager(org.infinispan.configuration.global.GlobalConfiguration, boolean) instead
DefaultCacheManager(GlobalConfiguration globalConfiguration, boolean start)
          Constructs a new instance of the CacheManager, using the global configuration passed in, and system defaults for the default named cache configuration.
DefaultCacheManager(GlobalConfiguration globalConfiguration, Configuration defaultConfiguration)
          Deprecated. 
DefaultCacheManager(GlobalConfiguration globalConfiguration, Configuration defaultConfiguration)
          Constructs and starts a new instance of the CacheManager, using the global and default configurations passed in.
DefaultCacheManager(GlobalConfiguration globalConfiguration, Configuration defaultConfiguration, boolean start)
          Deprecated. Use DefaultCacheManager(org.infinispan.configuration.global.GlobalConfiguration, org.infinispan.configuration.cache.Configuration, boolean) instead
DefaultCacheManager(GlobalConfiguration globalConfiguration, Configuration defaultConfiguration, boolean start)
          Constructs a new instance of the CacheManager, using the global and default configurations passed in.
DefaultCacheManager(InputStream configurationStream)
          Constructs and starts a new instance of the CacheManager, using the input stream passed in to read configuration file contents.
DefaultCacheManager(InputStream configurationStream, boolean start)
          Constructs a new instance of the CacheManager, using the input stream passed in to read configuration file contents.
DefaultCacheManager(String configurationFile)
          Constructs and starts a new instance of the CacheManager, using the configuration file name passed in.
DefaultCacheManager(String configurationFile, boolean start)
          Constructs a new instance of the CacheManager, using the configuration file name passed in.
DefaultCacheManager(String globalConfigurationFile, String defaultConfigurationFile, String namedCacheFile, boolean start)
          Deprecated. 
 
Method Summary
 void addListener(Object listener)
          Adds a listener to the component.
 boolean cacheExists(String cacheName)
          A cache is considered to exist if it has been created and started via one of the CacheContainer.getCache() methods and has not yet been removed via EmbeddedCacheManager.removeCache(String).
 Configuration defineConfiguration(String cacheName, Configuration configuration)
          Defines a named cache's configuration using the following algorithm:

Unlike previous versions of Infinispan, this method does not build on an existing configuration (default or named).

 Configuration defineConfiguration(String cacheName, Configuration configurationOverride)
          Deprecated. 
 Configuration defineConfiguration(String cacheName, String templateName, Configuration configurationOverride)
          Deprecated. 
 Configuration defineConfiguration(String cacheName, String templateName, Configuration configurationOverride)
           
 Address getAddress()
          
<K,V> Cache<K,V>
getCache()
          Retrieves the default cache associated with this cache manager.
<K,V> Cache<K,V>
getCache(String cacheName)
          Retrieves a named cache from the system.
<K,V> Cache<K,V>
getCache(String cacheName, boolean createIfAbsent)
          Retrieves a named cache from the system in the same way that CacheContainer.getCache(String) does except that if offers the possibility for the named cache not to be retrieved if it has not yet been started, or if it's been removed after being started.
 Configuration getCacheConfiguration(String name)
          Returns the configuration for the given cache.
 GlobalConfiguration getCacheManagerConfiguration()
          Returns global configuration for this CacheManager
 String getCacheManagerStatus()
           
 Set<String> getCacheNames()
          This method returns a collection of caches names which contains the caches that have been defined via XML or programmatically, and the caches that have been created at runtime via this cache manager instance.
 String getClusterMembers()
           
 String getClusterName()
          
 int getClusterSize()
           
 Address getCoordinator()
          
 String getCreatedCacheCount()
           
 Configuration getDefaultCacheConfiguration()
          Returns default configuration for this CacheManager
 Configuration getDefaultConfiguration()
          Returns default configuration for this CacheManager
 String getDefinedCacheCount()
           
 String getDefinedCacheNames()
           
 GlobalConfiguration getGlobalConfiguration()
          Returns global configuration for this CacheManager
 Set<Object> getListeners()
           
 List<Address> getMembers()
          
 String getName()
           
 String getNodeAddress()
           
 String getPhysicalAddresses()
           
 String getRunningCacheCount()
           
 ComponentStatus getStatus()
           
 Transport getTransport()
           
 String getVersion()
           
 boolean isCoordinator()
          
 boolean isDefaultRunning()
          Tests whether the default cache is running.
 boolean isRunning(String cacheName)
          Tests whether a named cache is running.
 void removeCache(String cacheName)
          Removes a cache with the given name from the system.
 void removeListener(Object listener)
          Removes a listener from the component.
 void start()
           
 void startCache()
           
 void startCache(String cacheName)
           
 EmbeddedCacheManager startCaches(String... cacheNames)
          Starts a set of caches in parallel.
 void stop()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OBJECT_NAME

public static final String OBJECT_NAME
See Also:
Constant Field Values

globalConfiguration

protected final GlobalConfiguration globalConfiguration

defaultConfiguration

protected final Configuration defaultConfiguration
Constructor Detail

DefaultCacheManager

public DefaultCacheManager()
Constructs and starts a default instance of the CacheManager, using configuration defaults. See Configuration and GlobalConfiguration for details of these defaults.


DefaultCacheManager

public DefaultCacheManager(boolean start)
Constructs a default instance of the CacheManager, using configuration defaults. See Configuration and GlobalConfiguration for details of these defaults.

Parameters:
start - if true, the cache manager is started

DefaultCacheManager

@Deprecated
public DefaultCacheManager(Configuration defaultConfiguration)
Deprecated. Use DefaultCacheManager(org.infinispan.configuration.cache.Configuration) instead

Constructs and starts a new instance of the CacheManager, using the default configuration passed in. Uses defaults for a GlobalConfiguration. See GlobalConfiguration for details of these defaults.

Parameters:
defaultConfiguration - configuration to use as a template for all caches created

DefaultCacheManager

public DefaultCacheManager(Configuration defaultConfiguration)
Constructs and starts a new instance of the CacheManager, using the default configuration passed in. See Configuration and GlobalConfiguration for details of these defaults.

Parameters:
defaultConfiguration - configuration to use as a template for all caches created

DefaultCacheManager

@Deprecated
public DefaultCacheManager(Configuration defaultConfiguration,
                                      boolean start)
Deprecated. Use DefaultCacheManager(org.infinispan.configuration.cache.Configuration, boolean) instead

Constructs a new instance of the CacheManager, using the default configuration passed in. Uses defaults for a GlobalConfiguration. See GlobalConfiguration for details of these defaults.

Parameters:
defaultConfiguration - configuration file to use as a template for all caches created
start - if true, the cache manager is started

DefaultCacheManager

public DefaultCacheManager(Configuration defaultConfiguration,
                           boolean start)
Constructs a new instance of the CacheManager, using the default configuration passed in. See GlobalConfiguration for details of these defaults.

Parameters:
defaultConfiguration - configuration file to use as a template for all caches created
start - if true, the cache manager is started

DefaultCacheManager

@Deprecated
public DefaultCacheManager(GlobalConfiguration globalConfiguration)
Deprecated. Use DefaultCacheManager(org.infinispan.configuration.global.GlobalConfiguration) instead

Constructs and starts a new instance of the CacheManager, using the global configuration passed in, and system defaults for the default named cache configuration. See Configuration for details of these defaults.

Parameters:
globalConfiguration - GlobalConfiguration to use for all caches created

DefaultCacheManager

public DefaultCacheManager(GlobalConfiguration globalConfiguration)
Constructs and starts a new instance of the CacheManager, using the global configuration passed in, and system defaults for the default named cache configuration. See Configuration for details of these defaults.

Parameters:
globalConfiguration - GlobalConfiguration to use for all caches created

DefaultCacheManager

@Deprecated
public DefaultCacheManager(GlobalConfiguration globalConfiguration,
                                      boolean start)
Deprecated. Use DefaultCacheManager(org.infinispan.configuration.global.GlobalConfiguration, boolean) instead

Constructs a new instance of the CacheManager, using the global configuration passed in, and system defaults for the default named cache configuration. See Configuration for details of these defaults.

Parameters:
globalConfiguration - GlobalConfiguration to use for all caches created
start - if true, the cache manager is started.

DefaultCacheManager

public DefaultCacheManager(GlobalConfiguration globalConfiguration,
                           boolean start)
Constructs a new instance of the CacheManager, using the global configuration passed in, and system defaults for the default named cache configuration. See Configuration for details of these defaults.

Parameters:
globalConfiguration - GlobalConfiguration to use for all caches created
start - if true, the cache manager is started.

DefaultCacheManager

@Deprecated
public DefaultCacheManager(GlobalConfiguration globalConfiguration,
                                      Configuration defaultConfiguration)
Deprecated. 

Constructs and starts a new instance of the CacheManager, using the global and default configurations passed in. If either of these are null, system defaults are used.

Parameters:
globalConfiguration - global configuration to use. If null, a default instance is created.
defaultConfiguration - default configuration to use. If null, a default instance is created. Use DefaultCacheManager(org.infinispan.configuration.global.GlobalConfiguration, org.infinispan.configuration.cache.Configuration) instead

DefaultCacheManager

public DefaultCacheManager(GlobalConfiguration globalConfiguration,
                           Configuration defaultConfiguration)
Constructs and starts a new instance of the CacheManager, using the global and default configurations passed in. If either of these are null, system defaults are used.

Parameters:
globalConfiguration - global configuration to use. If null, a default instance is created.
defaultConfiguration - default configuration to use. If null, a default instance is created.

DefaultCacheManager

@Deprecated
public DefaultCacheManager(GlobalConfiguration globalConfiguration,
                                      Configuration defaultConfiguration,
                                      boolean start)
Deprecated. Use DefaultCacheManager(org.infinispan.configuration.global.GlobalConfiguration, org.infinispan.configuration.cache.Configuration, boolean) instead

Constructs a new instance of the CacheManager, using the global and default configurations passed in. If either of these are null, system defaults are used.

Parameters:
globalConfiguration - global configuration to use. If null, a default instance is created.
defaultConfiguration - default configuration to use. If null, a default instance is created.
start - if true, the cache manager is started

DefaultCacheManager

public DefaultCacheManager(GlobalConfiguration globalConfiguration,
                           Configuration defaultConfiguration,
                           boolean start)
Constructs a new instance of the CacheManager, using the global and default configurations passed in. If either of these are null, system defaults are used.

Parameters:
globalConfiguration - global configuration to use. If null, a default instance is created.
defaultConfiguration - default configuration to use. If null, a default instance is created.
start - if true, the cache manager is started

DefaultCacheManager

public DefaultCacheManager(String configurationFile)
                    throws IOException
Constructs and starts a new instance of the CacheManager, using the configuration file name passed in. This constructor first searches for the named file on the classpath, and failing that, treats the file name as an absolute path.

Parameters:
configurationFile - name of configuration file to use as a template for all caches created
Throws:
IOException - if there is a problem with the configuration file.

DefaultCacheManager

public DefaultCacheManager(String configurationFile,
                           boolean start)
                    throws IOException
Constructs a new instance of the CacheManager, using the configuration file name passed in. This constructor first searches for the named file on the classpath, and failing that, treats the file name as an absolute path.

Parameters:
configurationFile - name of configuration file to use as a template for all caches created
start - if true, the cache manager is started
Throws:
IOException - if there is a problem with the configuration file.

DefaultCacheManager

public DefaultCacheManager(InputStream configurationStream)
                    throws IOException
Constructs and starts a new instance of the CacheManager, using the input stream passed in to read configuration file contents.

Parameters:
configurationStream - stream containing configuration file contents, to use as a template for all caches created
Throws:
IOException - if there is a problem with the configuration stream.

DefaultCacheManager

public DefaultCacheManager(InputStream configurationStream,
                           boolean start)
                    throws IOException
Constructs a new instance of the CacheManager, using the input stream passed in to read configuration file contents.

Parameters:
configurationStream - stream containing configuration file contents, to use as a template for all caches created
start - if true, the cache manager is started
Throws:
IOException - if there is a problem reading the configuration stream

DefaultCacheManager

public DefaultCacheManager(ConfigurationBuilderHolder holder,
                           boolean start)
Constructs a new instance of the CacheManager, using the holder passed in to read configuration settings.

Parameters:
holder - holder containing configuration settings, to use as a template for all caches created
start - if true, the cache manager is started

DefaultCacheManager

@Deprecated
public DefaultCacheManager(String globalConfigurationFile,
                                      String defaultConfigurationFile,
                                      String namedCacheFile,
                                      boolean start)
                    throws IOException
Deprecated. 

Constructs a new instance of the CacheManager, using the two configuration file names passed in. The first file contains the GlobalConfiguration configuration The second file contain the Default configuration. The third filename contains the named cache configuration This constructor first searches for the named file on the classpath, and failing that, treats the file name as an absolute path.

Parameters:
start - if true, the cache manager is started
globalConfigurationFile - name of file that contains the global configuration
defaultConfigurationFile - name of file that contains the default configuration
namedCacheFile - name of file that contains the named cache configuration
Throws:
IOException - if there is a problem with the configuration file.
Method Detail

defineConfiguration

public Configuration defineConfiguration(String cacheName,
                                         Configuration configuration)
Description copied from interface: EmbeddedCacheManager
Defines a named cache's configuration using the following algorithm:

Unlike previous versions of Infinispan, this method does not build on an existing configuration (default or named). If you want this behavior, then use ConfigurationBuilder.read(org.infinispan.configuration.cache.Configuration).

The other way to define named cache's configuration is declaratively, in the XML file passed in to the cache manager. This method enables you to override certain properties that have previously been defined via XML.

Passing a brand new Configuration instance as configuration override without having called any of its setters will effectively return the named cache's configuration since no overrides where passed to it.

Specified by:
defineConfiguration in interface EmbeddedCacheManager
Parameters:
cacheName - name of cache whose configuration is being defined
configuration - configuration overrides to use
Returns:
a cloned configuration instance

defineConfiguration

@Deprecated
public Configuration defineConfiguration(String cacheName,
                                                    Configuration configurationOverride)
Deprecated. 

Defines a named cache's configuration using the following algorithm:

If cache name hasn't been defined before, this method creates a clone of the default cache's configuration, applies a clone of the configuration overrides passed in and returns this configuration instance.

If cache name has been previously defined, this method creates a clone of this cache's existing configuration, applies a clone of the configuration overrides passed in and returns the configuration instance.

The other way to define named cache's configuration is declaratively, in the XML file passed in to the cache manager. This method enables you to override certain properties that have previously been defined via XML.

Passing a brand new Configuration instance as configuration override without having called any of its setters will effectively return the named cache's configuration since no overrides where passed to it.

Specified by:
defineConfiguration in interface EmbeddedCacheManager
Parameters:
cacheName - name of cache whose configuration is being defined
configurationOverride - configuration overrides to use
Returns:
a cloned configuration instance

defineConfiguration

@Deprecated
public Configuration defineConfiguration(String cacheName,
                                                    String templateName,
                                                    Configuration configurationOverride)
Deprecated. 

Defines a named cache's configuration using the following algorithm:

Regardless of whether the cache name has been defined or not, this method creates a clone of the configuration of the cache whose name matches the given template cache name, then applies a clone of the configuration overrides passed in and finally returns this configuration instance.

The other way to define named cache's configuration is declaratively, in the XML file passed in to the cache manager. This method enables you to override certain properties that have previously been defined via XML.

Passing a brand new Configuration instance as configuration override without having called any of its setters will effectively return the named cache's configuration since no overrides where passed to it.

If templateName is null or there isn't any named cache with that name, this methods works exactly like EmbeddedCacheManager.defineConfiguration(String, Configuration) in the sense that the base configuration used is the default cache configuration.

Specified by:
defineConfiguration in interface EmbeddedCacheManager
Parameters:
cacheName - name of cache whose configuration is being defined
templateName - name of cache to which to which apply overrides if cache name has not been previously defined
configurationOverride - configuration overrides to use
Returns:
a cloned configuration instance

defineConfiguration

public Configuration defineConfiguration(String cacheName,
                                         String templateName,
                                         Configuration configurationOverride)

getCache

public <K,V> Cache<K,V> getCache()
Retrieves the default cache associated with this cache manager. Note that the default cache does not need to be explicitly created with createCache(String) since it is automatically created lazily when first used.

As such, this method is always guaranteed to return the default cache.

Specified by:
getCache in interface BasicCacheContainer
Specified by:
getCache in interface CacheContainer
Returns:
the default cache.

getCache

public <K,V> Cache<K,V> getCache(String cacheName)
Retrieves a named cache from the system. If the cache has been previously created with the same name, the running cache instance is returned. Otherwise, this method attempts to create the cache first.

When creating a new cache, this method will use the configuration passed in to the CacheManager on construction, as a template, and then optionally apply any overrides previously defined for the named cache using the defineConfiguration(String, Configuration) or defineConfiguration(String, String, Configuration) methods, or declared in the configuration file.

Specified by:
getCache in interface BasicCacheContainer
Specified by:
getCache in interface CacheContainer
Parameters:
cacheName - name of cache to retrieve
Returns:
a cache instance identified by cacheName

cacheExists

public boolean cacheExists(String cacheName)
Description copied from interface: EmbeddedCacheManager
A cache is considered to exist if it has been created and started via one of the CacheContainer.getCache() methods and has not yet been removed via EmbeddedCacheManager.removeCache(String).

In environments when caches are continuously created and removed, this method offers the possibility to find out whether a cache has either, not been started, or if it was started, whether it's been removed already or not.

Specified by:
cacheExists in interface EmbeddedCacheManager
Returns:
true if the cache with the given name has not yet been started, or if it was started, whether it's been removed or not.

getCache

public <K,V> Cache<K,V> getCache(String cacheName,
                                 boolean createIfAbsent)
Description copied from interface: EmbeddedCacheManager
Retrieves a named cache from the system in the same way that CacheContainer.getCache(String) does except that if offers the possibility for the named cache not to be retrieved if it has not yet been started, or if it's been removed after being started.

Specified by:
getCache in interface EmbeddedCacheManager
Parameters:
cacheName - name of cache to retrieve
createIfAbsent - if false, the named cache will not be retrieved if it hasn't been retrieved previously or if it's been removed. If true, this methods works just like CacheContainer.getCache(String)
Returns:
null if no named cache exists as per rules set above, otherwise returns a cache instance identified by cacheName

startCaches

public EmbeddedCacheManager startCaches(String... cacheNames)
Description copied from interface: EmbeddedCacheManager
Starts a set of caches in parallel. Infinispan supports both symmetric and asymmetric clusters; that is, multiple nodes having the same or different sets of caches running, respectively. Calling this method on application/application server startup with all your cache names will ensure that the cluster is symmetric.

Specified by:
startCaches in interface EmbeddedCacheManager
Parameters:
cacheNames - the names of the caches to start

removeCache

public void removeCache(String cacheName)
Description copied from interface: EmbeddedCacheManager
Removes a cache with the given name from the system. This is a cluster wide operation that results not only in stopping the cache with the given name in all nodes in the cluster, but also deletes its contents both in memory and in any backing cache store.

Specified by:
removeCache in interface EmbeddedCacheManager
Parameters:
cacheName - name of cache to remove

getMembers

public List<Address> getMembers()

Specified by:
getMembers in interface EmbeddedCacheManager
Returns:
the addresses of all the members in the cluster.

getAddress

public Address getAddress()

Specified by:
getAddress in interface EmbeddedCacheManager
Returns:
the address of the local node

getCoordinator

public Address getCoordinator()

Specified by:
getCoordinator in interface EmbeddedCacheManager
Returns:
the address of the cluster's coordinator

isCoordinator

public boolean isCoordinator()

Specified by:
isCoordinator in interface EmbeddedCacheManager
Returns:
whether the local node is the cluster's coordinator

start

public void start()
Specified by:
start in interface Lifecycle

stop

public void stop()
Specified by:
stop in interface Lifecycle

addListener

public void addListener(Object listener)
Description copied from interface: Listenable
Adds a listener to the component. Typically, listeners would need to be annotated with Listener and further to that, contain methods annotated appropriately, otherwise the listener will not be registered.

See the Listener annotation for more information.

Specified by:
addListener in interface Listenable
Parameters:
listener - must not be null.

removeListener

public void removeListener(Object listener)
Description copied from interface: Listenable
Removes a listener from the component.

Specified by:
removeListener in interface Listenable
Parameters:
listener - listener to remove. Must not be null.

getListeners

public Set<Object> getListeners()
Specified by:
getListeners in interface Listenable
Returns:
a set of all listeners registered on this component.

getStatus

public ComponentStatus getStatus()
Specified by:
getStatus in interface EmbeddedCacheManager
Returns:
the status of the cache manager

getGlobalConfiguration

public GlobalConfiguration getGlobalConfiguration()
Description copied from interface: EmbeddedCacheManager
Returns global configuration for this CacheManager

Specified by:
getGlobalConfiguration in interface EmbeddedCacheManager
Returns:
the global configuration object associated to this CacheManager

getCacheManagerConfiguration

public GlobalConfiguration getCacheManagerConfiguration()
Description copied from interface: EmbeddedCacheManager
Returns global configuration for this CacheManager

Specified by:
getCacheManagerConfiguration in interface EmbeddedCacheManager
Returns:
the global configuration object associated to this CacheManager

getDefaultConfiguration

public Configuration getDefaultConfiguration()
Description copied from interface: EmbeddedCacheManager
Returns default configuration for this CacheManager

Specified by:
getDefaultConfiguration in interface EmbeddedCacheManager
Returns:
the default configuration associated with this CacheManager

getDefaultCacheConfiguration

public Configuration getDefaultCacheConfiguration()
Description copied from interface: EmbeddedCacheManager
Returns default configuration for this CacheManager

Specified by:
getDefaultCacheConfiguration in interface EmbeddedCacheManager
Returns:
the default configuration associated with this CacheManager

getCacheConfiguration

public Configuration getCacheConfiguration(String name)
Description copied from interface: EmbeddedCacheManager
Returns the configuration for the given cache.

Specified by:
getCacheConfiguration in interface EmbeddedCacheManager
Returns:
the configuration for the given cache or null if no such cache is defined

getCacheNames

public Set<String> getCacheNames()
Description copied from interface: EmbeddedCacheManager
This method returns a collection of caches names which contains the caches that have been defined via XML or programmatically, and the caches that have been created at runtime via this cache manager instance. If no named caches are registered or no caches have been created, this method returns an empty set. The default cache is never included in this set of cache names.

Specified by:
getCacheNames in interface EmbeddedCacheManager
Returns:
an immutable set of non-default named caches registered or created with this cache manager.

isRunning

public boolean isRunning(String cacheName)
Description copied from interface: EmbeddedCacheManager
Tests whether a named cache is running.

Specified by:
isRunning in interface EmbeddedCacheManager
Parameters:
cacheName - name of cache to test.
Returns:
true if the named cache exists and is running; false otherwise.

isDefaultRunning

public boolean isDefaultRunning()
Description copied from interface: EmbeddedCacheManager
Tests whether the default cache is running.

Specified by:
isDefaultRunning in interface EmbeddedCacheManager
Returns:
true if the default cache is running; false otherwise.

getCacheManagerStatus

public String getCacheManagerStatus()

getDefinedCacheNames

public String getDefinedCacheNames()

getDefinedCacheCount

public String getDefinedCacheCount()

getCreatedCacheCount

public String getCreatedCacheCount()

getRunningCacheCount

public String getRunningCacheCount()

getVersion

public String getVersion()

getName

public String getName()

startCache

public void startCache()

startCache

public void startCache(String cacheName)

getNodeAddress

public String getNodeAddress()

getPhysicalAddresses

public String getPhysicalAddresses()

getClusterMembers

public String getClusterMembers()

getClusterSize

public int getClusterSize()

getClusterName

public String getClusterName()

Specified by:
getClusterName in interface EmbeddedCacheManager
Returns:
the name of the cluster. Null if running in local mode.

getTransport

public Transport getTransport()
Specified by:
getTransport in interface EmbeddedCacheManager

toString

public String toString()
Overrides:
toString in class Object

-->

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