Package org.infinispan.manager
Class DefaultCacheManager
- java.lang.Object
-
- org.infinispan.manager.DefaultCacheManager
-
- All Implemented Interfaces:
Closeable,AutoCloseable,BasicCacheContainer,Lifecycle,CacheContainer,EmbeddedCacheManager,Listenable
public class DefaultCacheManager extends Object implements EmbeddedCacheManager
A CacheManager is the primary mechanism for retrieving aCacheinstance, and is often used as a starting point to using theCache. 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 aConfigurationor a path or URL to a configuration XML file. Lifecycle - CacheManagers have a lifecycle (it implementsLifecycle) and the default constructors also callstart(). 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 callstop()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.createCache("myReplicatedCache", confBuilder.build()); Cache<String, String> replicatedCache = manager.getCache("myReplicatedCache");- Since:
- 4.0
- Author:
- Manik Surtani, Galder ZamarreƱo
-
-
Field Summary
Fields Modifier and Type Field Description static StringOBJECT_NAME-
Fields inherited from interface org.infinispan.commons.api.BasicCacheContainer
DEFAULT_CACHE_NAME
-
-
Constructor Summary
Constructors Constructor Description 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(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(Configuration defaultConfiguration)Constructs and starts a new instance of the CacheManager, using the default configuration passed in.DefaultCacheManager(Configuration defaultConfiguration, boolean start)Constructs a new instance of the CacheManager, using the default configuration passed in.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)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)Constructs and starts a new instance of the CacheManager, using the global and default configurations passed in.DefaultCacheManager(GlobalConfiguration globalConfiguration, Configuration defaultConfiguration, boolean start)Constructs a new instance of the CacheManager, using the global and default configurations passed in.DefaultCacheManager(ConfigurationBuilderHolder holder, boolean start)Constructs a new instance of the CacheManager, using the holder passed in to read configuration settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCacheDependency(String from, String to)Add a dependency between two caches.voidaddListener(Object listener)Adds a listener to the component.EmbeddedCacheManagerAdminadministration()Provides anEmbeddedCacheManagerAdminwhose methods affect the entire cluster as opposed to a single node.booleancacheExists(String cacheName)A cache is considered to exist if it has been created and started via one of theCacheContainer.getCache()methods and has not yet been removed viaEmbeddedCacheManager.removeCache(String).voidclose()<K,V>
Cache<K,V>createCache(String name, Configuration configuration)Creates a cache on the local node using the supplied configuration.ConfigurationdefineConfiguration(String name, String template, Configuration configurationOverride)Defines a named cache's configuration using by first reading the template configuration and then applying the override afterwards to generate a configuration.ConfigurationdefineConfiguration(String name, Configuration configuration)Defines a named cache's configuration by using the provided configurationClusterExecutorexecutor()Providess the cache manager based executor.AddressgetAddress()Warning: the address may benullbefore the first clustered cache starts and after all the clustered caches have been stopped.<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 thatCacheContainer.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.<K,V>
Cache<K,V>getCache(String cacheName, String configurationName)Retrieves a named cache from the system in the same way thatCacheContainer.getCache(String)does except that if offers the possibility to specify a specific configuration template.<K,V>
Cache<K,V>getCache(String cacheName, String configurationTemplate, boolean createIfAbsent)Retrieves a named cache from the system in the same way thatCacheContainer.getCache(String)does except that if offers the possibility to specify a specific configuration template.ConfigurationgetCacheConfiguration(String name)Returns the configuration for the given cache.Set<String>getCacheConfigurationNames()This method returns a collection of cache configuration names which contains the cache configurations that have been defined via XML or programmatically, and the cache configurations that have been defined at runtime via this cache manager instance.GlobalConfigurationgetCacheManagerConfiguration()Returns global configuration for this CacheManagerStringgetCacheManagerStatus()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.ClassWhiteListgetClassWhiteList()StringgetClusterMembers()StringgetClusterName()intgetClusterSize()AddressgetCoordinator()StringgetCoordinatorAddress()StringgetCreatedCacheCount()ConfigurationgetDefaultCacheConfiguration()Returns default configuration for this CacheManagerStringgetDefinedCacheConfigurationNames()StringgetDefinedCacheCount()StringgetDefinedCacheNames()GlobalComponentRegistrygetGlobalComponentRegistry()PropertiesgetGlobalConfigurationAsProperties()HealthgetHealth()Returns an entry point for a Health Check API.Set<Object>getListeners()List<Address>getMembers()StringgetName()StringgetNodeAddress()StringgetPhysicalAddresses()StringgetRunningCacheCount()CacheContainerStatsgetStats()Returns statistics for this cache manager since 7.1ComponentStatusgetStatus()TransportgetTransport()StringgetVersion()<K,V>
Cache<K,V>internalGetCache(String cacheName, String configurationName)booleanisCoordinator()booleanisDefaultRunning()Tests whether the default cache is running.booleanisRunning(String cacheName)Tests whether a named cache is running.voidremoveCache(String cacheName)Removes a cache with the given name from the system.voidremoveListener(Object listener)Removes a listener from the component.voidstart()Invoked on component startvoidstartCache()voidstartCache(String cacheName)EmbeddedCacheManagerstartCaches(String... cacheNames)Starts a set of caches in parallel.voidstop()Invoked on component stopStringtoString()voidundefineConfiguration(String configurationName)Removes a configuration from the set of defined configurations.
-
-
-
Field Detail
-
OBJECT_NAME
public static final String OBJECT_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultCacheManager
public DefaultCacheManager()
Constructs and starts a default instance of the CacheManager, using configuration defaults. SeeConfigurationandGlobalConfigurationfor details of these defaults.
-
DefaultCacheManager
public DefaultCacheManager(boolean start)
Constructs a default instance of the CacheManager, using configuration defaults. SeeConfigurationandGlobalConfigurationfor details of these defaults.- Parameters:
start- if true, the cache manager is started
-
DefaultCacheManager
public DefaultCacheManager(Configuration defaultConfiguration)
Constructs and starts a new instance of the CacheManager, using the default configuration passed in. SeeConfigurationandGlobalConfigurationfor details of these defaults.- Parameters:
defaultConfiguration- configuration to use as a template for all caches created
-
DefaultCacheManager
public DefaultCacheManager(Configuration defaultConfiguration, boolean start)
Constructs a new instance of the CacheManager, using the default configuration passed in. SeeGlobalConfigurationfor details of these defaults.- Parameters:
defaultConfiguration- configuration file to use as a template for all caches createdstart- if true, the cache manager is started
-
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. SeeConfigurationfor details of these defaults.- Parameters:
globalConfiguration- GlobalConfiguration to use for all caches created
-
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. SeeConfigurationfor details of these defaults.- Parameters:
globalConfiguration- GlobalConfiguration to use for all caches createdstart- if true, the cache manager is started.
-
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
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 createdstart- 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 createdstart- 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 createdstart- if true, the cache manager is started
-
-
Method Detail
-
defineConfiguration
public Configuration defineConfiguration(String name, Configuration configuration)
Description copied from interface:EmbeddedCacheManagerDefines a named cache's configuration by using the provided configuration Unlike previous versions of Infinispan, this method does not build on an existing configuration (default or named). If you want this behavior, then useConfigurationBuilder.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. If this cache was already configured either declaritively or programmatically this method will throw aCacheConfigurationException.- Specified by:
defineConfigurationin interfaceEmbeddedCacheManager- Parameters:
name- name of cache whose configuration is being definedconfiguration- configuration overrides to use- Returns:
- a cloned configuration instance
-
defineConfiguration
public Configuration defineConfiguration(String name, String template, Configuration configurationOverride)
Description copied from interface:EmbeddedCacheManagerDefines a named cache's configuration using by first reading the template configuration and then applying the override afterwards to generate a configuration. The other way to define named cache's configuration is declaratively, in the XML file passed in to the cache manager. If templateName is null or there isn't any named cache with that name, this methods works exactly likeEmbeddedCacheManager.defineConfiguration(String, Configuration). If this cache was already configured either declaratively or programmatically this method will throw aCacheConfigurationException.- Specified by:
defineConfigurationin interfaceEmbeddedCacheManager- Parameters:
name- name of cache whose configuration is being definedtemplate- name of cache to use as a template before overrides are applied to itconfigurationOverride- configuration overrides to use- Returns:
- a cloned configuration instance
-
undefineConfiguration
public void undefineConfiguration(String configurationName)
Description copied from interface:EmbeddedCacheManagerRemoves a configuration from the set of defined configurations. If the configuration is currently in use by one of the caches, anIllegalStateExceptionis thrown. If the named configuration does not exist, nothing happens- Specified by:
undefineConfigurationin interfaceEmbeddedCacheManager- Parameters:
configurationName- the named configuration
-
createCache
public <K,V> Cache<K,V> createCache(String name, Configuration configuration)
Description copied from interface:EmbeddedCacheManagerCreates a cache on the local node using the supplied configuration. The cache may be clustered, but this method (or an equivalent combination ofEmbeddedCacheManager.defineConfiguration(String, Configuration)andEmbeddedCacheManager.getCache(String, boolean)) needs to be invoked on all nodes.- Specified by:
createCachein interfaceEmbeddedCacheManager- Type Parameters:
K- the generic type of the keyV- the generic type of the value- Parameters:
name- the name of the cacheconfiguration- the configuration to use.- Returns:
- the cache
-
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 withcreateCache(String, String)(String)} since it is automatically created lazily when first used. As such, this method is always guaranteed to return the default cache.- Specified by:
getCachein interfaceBasicCacheContainer- Specified by:
getCachein interfaceCacheContainer- 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 thedefineConfiguration(String, Configuration)ordefineConfiguration(String, String, Configuration)methods, or declared in the configuration file.- Specified by:
getCachein interfaceBasicCacheContainer- Specified by:
getCachein interfaceCacheContainer- Parameters:
cacheName- name of cache to retrieve- Returns:
- a cache instance identified by cacheName
-
getCache
public <K,V> Cache<K,V> getCache(String cacheName, String configurationName)
Description copied from interface:EmbeddedCacheManagerRetrieves a named cache from the system in the same way thatCacheContainer.getCache(String)does except that if offers the possibility to specify a specific configuration template. Multiple caches can be created using the same configuration.- Specified by:
getCachein interfaceEmbeddedCacheManager- Parameters:
cacheName- name of cache to retrieveconfigurationName- name of the configuration template to use- Returns:
- null if no configuration exists as per rules set above, otherwise returns a cache instance identified by cacheName
-
internalGetCache
public <K,V> Cache<K,V> internalGetCache(String cacheName, String configurationName)
-
cacheExists
public boolean cacheExists(String cacheName)
Description copied from interface:EmbeddedCacheManagerA cache is considered to exist if it has been created and started via one of theCacheContainer.getCache()methods and has not yet been removed viaEmbeddedCacheManager.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:
cacheExistsin interfaceEmbeddedCacheManager- 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:EmbeddedCacheManagerRetrieves a named cache from the system in the same way thatCacheContainer.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. If a non-template configuration exists with the same name, it will be used to configure the cache.- Specified by:
getCachein interfaceEmbeddedCacheManager- Parameters:
cacheName- name of cache to retrievecreateIfAbsent- 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 likeCacheContainer.getCache(String)- Returns:
- null if no named cache exists as per rules set above, otherwise returns a cache instance identified by cacheName
-
getCache
public <K,V> Cache<K,V> getCache(String cacheName, String configurationTemplate, boolean createIfAbsent)
Description copied from interface:EmbeddedCacheManagerRetrieves a named cache from the system in the same way thatCacheContainer.getCache(String)does except that if offers the possibility to specify a specific configuration template. Multiple caches can be created using the same configuration. Tihs method also 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:
getCachein interfaceEmbeddedCacheManager- Parameters:
cacheName- name of cache to retrieveconfigurationTemplate- name of the configuration template to usecreateIfAbsent- 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 likeEmbeddedCacheManager.getCache(String, String)- Returns:
- null if no configuration exists as per rules set above, otherwise returns a cache instance identified by cacheName
-
startCaches
public EmbeddedCacheManager startCaches(String... cacheNames)
Description copied from interface:EmbeddedCacheManagerStarts 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:
startCachesin interfaceEmbeddedCacheManager- Parameters:
cacheNames- the names of the caches to start
-
removeCache
public void removeCache(String cacheName)
Description copied from interface:EmbeddedCacheManagerRemoves 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:
removeCachein interfaceEmbeddedCacheManager- Parameters:
cacheName- name of cache to remove
-
getMembers
public List<Address> getMembers()
- Specified by:
getMembersin interfaceEmbeddedCacheManager- Returns:
- the addresses of all the members in the cluster, or
nullif not connected
-
getAddress
public Address getAddress()
Warning: the address may benullbefore the first clustered cache starts and after all the clustered caches have been stopped.- Specified by:
getAddressin interfaceEmbeddedCacheManager- Returns:
- the address of the local node, or
nullif not connected
-
getCoordinator
public Address getCoordinator()
- Specified by:
getCoordinatorin interfaceEmbeddedCacheManager- Returns:
- the address of the cluster's coordinator, or
nullif not connected
-
getCoordinatorAddress
public String getCoordinatorAddress()
-
isCoordinator
public boolean isCoordinator()
- Specified by:
isCoordinatorin interfaceEmbeddedCacheManager- Returns:
- whether the local node is the cluster's coordinator, or
nullif not connected
-
start
public void start()
Description copied from interface:LifecycleInvoked on component start
-
stop
public void stop()
Description copied from interface:LifecycleInvoked on component stop
-
addListener
public void addListener(Object listener)
Description copied from interface:ListenableAdds a listener to the component. Typically, listeners would need to be annotated withListenerand further to that, contain methods annotated appropriately, otherwise the listener will not be registered. See theListenerannotation for more information.- Specified by:
addListenerin interfaceListenable- Parameters:
listener- must not be null.
-
removeListener
public void removeListener(Object listener)
Description copied from interface:ListenableRemoves a listener from the component.- Specified by:
removeListenerin interfaceListenable- Parameters:
listener- listener to remove. Must not be null.
-
getListeners
public Set<Object> getListeners()
- Specified by:
getListenersin interfaceListenable- Returns:
- a set of all listeners registered on this component.
-
getStatus
public ComponentStatus getStatus()
- Specified by:
getStatusin interfaceEmbeddedCacheManager- Returns:
- the status of the cache manager
-
getCacheManagerConfiguration
public GlobalConfiguration getCacheManagerConfiguration()
Description copied from interface:EmbeddedCacheManagerReturns global configuration for this CacheManager- Specified by:
getCacheManagerConfigurationin interfaceEmbeddedCacheManager- Returns:
- the global configuration object associated to this CacheManager
-
getDefaultCacheConfiguration
public Configuration getDefaultCacheConfiguration()
Description copied from interface:EmbeddedCacheManagerReturns default configuration for this CacheManager- Specified by:
getDefaultCacheConfigurationin interfaceEmbeddedCacheManager- Returns:
- the default configuration associated with this CacheManager
-
getCacheConfiguration
public Configuration getCacheConfiguration(String name)
Description copied from interface:EmbeddedCacheManagerReturns the configuration for the given cache.- Specified by:
getCacheConfigurationin interfaceEmbeddedCacheManager- Returns:
- the configuration for the given cache or null if no such cache is defined
-
getCacheNames
public Set<String> getCacheNames()
Description copied from interface:BasicCacheContainerThis 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 list of caches does not include internal-only cachesInternalCacheRegistry- Specified by:
getCacheNamesin interfaceBasicCacheContainer- Returns:
- an immutable set of caches registered or created with this cache manager.
-
getCacheConfigurationNames
public Set<String> getCacheConfigurationNames()
Description copied from interface:EmbeddedCacheManagerThis method returns a collection of cache configuration names which contains the cache configurations that have been defined via XML or programmatically, and the cache configurations that have been defined at runtime via this cache manager instance. If no cache configurations 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, as well a caches for internal-only useInternalCacheRegistry- Specified by:
getCacheConfigurationNamesin interfaceEmbeddedCacheManager- 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:EmbeddedCacheManagerTests whether a named cache is running.- Specified by:
isRunningin interfaceEmbeddedCacheManager- 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:EmbeddedCacheManagerTests whether the default cache is running.- Specified by:
isDefaultRunningin interfaceEmbeddedCacheManager- Returns:
- true if the default cache is running; false otherwise.
-
getCacheManagerStatus
public String getCacheManagerStatus()
-
getDefinedCacheNames
public String getDefinedCacheNames()
-
getDefinedCacheConfigurationNames
public String getDefinedCacheConfigurationNames()
-
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:
getClusterNamein interfaceEmbeddedCacheManager- Returns:
- the name of the cluster. Null if running in local mode.
-
getTransport
public Transport getTransport()
- Specified by:
getTransportin interfaceEmbeddedCacheManager
-
getGlobalComponentRegistry
public GlobalComponentRegistry getGlobalComponentRegistry()
- Specified by:
getGlobalComponentRegistryin interfaceEmbeddedCacheManager
-
addCacheDependency
public void addCacheDependency(String from, String to)
Description copied from interface:EmbeddedCacheManagerAdd a dependency between two caches. The cache manager will make sure that a cache is stopped before any of its dependencies- Specified by:
addCacheDependencyin interfaceEmbeddedCacheManager- Parameters:
from- cache nameto- cache name
-
getGlobalConfigurationAsProperties
public Properties getGlobalConfigurationAsProperties()
-
getStats
public CacheContainerStats getStats()
Description copied from interface:EmbeddedCacheManagerReturns statistics for this cache manager since 7.1- Specified by:
getStatsin interfaceEmbeddedCacheManager- Returns:
- statistics for this cache manager
-
getHealth
public Health getHealth()
Description copied from interface:EmbeddedCacheManagerReturns an entry point for a Health Check API.- Specified by:
getHealthin interfaceEmbeddedCacheManager- Returns:
- Health API for this
EmbeddedCacheManager.
-
executor
public ClusterExecutor executor()
Description copied from interface:EmbeddedCacheManagerProvidess the cache manager based executor. This can be used to execute a given operation upon the cluster or a single node if desired. If this manager is not clustered this will execute locally only.Note that not all
EmbeddedCacheManagerimplementations may implement this. Those that don't will throw aUnsupportedOperationExceptionupon invocation.- Specified by:
executorin interfaceEmbeddedCacheManager- Returns:
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getClassWhiteList
public ClassWhiteList getClassWhiteList()
- Specified by:
getClassWhiteListin interfaceEmbeddedCacheManager
-
administration
public EmbeddedCacheManagerAdmin administration()
Description copied from interface:EmbeddedCacheManagerProvides anEmbeddedCacheManagerAdminwhose methods affect the entire cluster as opposed to a single node.- Specified by:
administrationin interfaceCacheContainer- Specified by:
administrationin interfaceEmbeddedCacheManager- Returns:
- a cluster-aware
EmbeddedCacheManagerAdmin
-
-