|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.cache.CacheManagerImpl
public class CacheManagerImpl
Basic implementation of CacheManager.
| Constructor Summary | |
|---|---|
CacheManagerImpl()
Create a new CacheRegistryImpl. |
|
CacheManagerImpl(ConfigurationRegistry configRegistry,
org.jgroups.ChannelFactory factory)
Create a new CacheRegistryImpl using the provided ConfigurationRegistry and ChannelFactory. |
|
CacheManagerImpl(String configFileName,
org.jgroups.ChannelFactory factory)
Create a new CacheRegistryImpl using the provided ChannelFactory and using the provided file name to create an XmlParsingConfigurationRegistry. |
|
| Method Summary | |
|---|---|
protected Cache<Object,Object> |
createCache(Configuration config)
Extension point for subclasses, where we actually use a CacheFactory to create a cache. |
Cache<Object,Object> |
getCache(String configName,
boolean create)
Get a cache configured according to the given configuration name, optionally instantiating the cache if it hasn't already been instantiated. |
Set<String> |
getCacheNames()
Gets the name of all caches that are registered, i.e. |
org.jgroups.ChannelFactory |
getChannelFactory()
Gets the JGroups ChannelFactory that will be injected
into any Configuration that has a
multiplexer stack
configured. |
Set<String> |
getConfigurationNames()
Gets the names of all the configurations of which this object is aware. |
ConfigurationRegistry |
getConfigurationRegistry()
|
void |
registerCache(Cache<Object,Object> cache,
String configName)
|
void |
releaseCache(String configName)
Notifies the registry that the caller is no longer using the given cache. |
void |
setChannelFactory(org.jgroups.ChannelFactory channelFactory)
|
void |
setConfigurationRegistry(ConfigurationRegistry configRegistry)
|
void |
start()
|
void |
stop()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CacheManagerImpl()
public CacheManagerImpl(ConfigurationRegistry configRegistry,
org.jgroups.ChannelFactory factory)
public CacheManagerImpl(String configFileName,
org.jgroups.ChannelFactory factory)
XmlParsingConfigurationRegistry.
| Method Detail |
|---|
public org.jgroups.ChannelFactory getChannelFactory()
CacheManagerChannelFactory that will be injected
into any Configuration that has a
multiplexer stack
configured.
getChannelFactory in interface CacheManagerpublic Set<String> getConfigurationNames()
CacheManager
getConfigurationNames in interface CacheManagernull.public Set<String> getCacheNames()
CacheManagergetCache(name, false).
getCacheNames in interface CacheManagernull.
public Cache<Object,Object> getCache(String configName,
boolean create)
throws Exception
CacheManager
The caller is free to invoke the Cache.create() and
Cache.start() lifecycle methods on the returned cache, but
the @link Cache#stop()} and Cache.destroy() methods should not
be invoked, since it is quite possible other users are still using the
cache. Use CacheManager.releaseCache(String) to notify this
registry that the caller is no longer using a cache; let the registry
control stopping and destroying the cache.
If invoking this method leads to the instantiation of the cache,
create() and start() will not be invoked
on the cache before it is returned.
getCache in interface CacheManagerconfigName - the name of the configurationcreate - should the cache be instantiated if it
hasn't already been?
null if
create is false and the cache hasn't
been created previously.
IllegalArgumentException - if this object is unaware of
configName; i.e. the set
returned from CacheManager.getConfigurationNames()
does not include configName
Exception - if there is a problem instantiating the cacheprotected Cache<Object,Object> createCache(Configuration config)
CacheFactory to create a cache. This default implementation
uses DefaultCacheFactory.
config - the Configuration for the cache
public void releaseCache(String configName)
CacheManager
releaseCache in interface CacheManagerpublic ConfigurationRegistry getConfigurationRegistry()
public void setConfigurationRegistry(ConfigurationRegistry configRegistry)
public void setChannelFactory(org.jgroups.ChannelFactory channelFactory)
public void registerCache(Cache<Object,Object> cache,
String configName)
public void start()
throws Exception
Exceptionpublic void stop()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||