|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jcs.engine.control.CompositeCacheManager
Manages a composite cache. This provides access to caches and is the primary way to shutdown the caching system as a whole.
Field Summary | |
protected java.util.Hashtable |
auxAttrs
??? |
protected java.util.Hashtable |
auxFacs
Used to keep track of configured auxiliaries |
protected java.util.Hashtable |
caches
Caches managed by this cache manager |
protected java.lang.String |
defaultAuxValues
The default auxiliary caches to be used if not preconfigured |
protected ICompositeCacheAttributes |
defaultCacheAttr
Default cache attributes for this cache manager |
protected IElementAttributes |
defaultElementAttr
Default elemeent attributes for this cache manager |
protected static CompositeCacheManager |
instance
The Singleton Instance |
protected java.util.Properties |
props
Properties with which this manager was configured |
protected java.util.Hashtable |
systemCaches
Internal system caches for this cache manager |
Fields inherited from interface org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheConstants |
REMOTE_ALLOW_CLUSTER_GET, REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_PORT, REMOTE_CACHE_SERVICE_VAL, REMOTE_LOCAL_CLUSTER_CONSISTENCY, TOMCAT_ON, TOMCAT_XML |
Constructor Summary | |
CompositeCacheManager()
|
Method Summary | |
void |
configure()
Configure with default properties file |
void |
configure(java.util.Properties props)
Configure from properties object. |
void |
configure(java.util.Properties props,
boolean useSystemProperties)
Configure from properties object, overriding with values from the system properteis if instructed. |
void |
configure(java.lang.String propFile)
Configure from specific properties file. |
protected static CompositeCacheManager |
createInstance()
Simple factory method, must override in subclasses so getInstance creates / returns the correct object. |
void |
deregisterShutdownObserver(IShutdownObserver observer)
Deregisters the observer with the observable. |
void |
freeCache(java.lang.String name)
|
void |
freeCache(java.lang.String name,
boolean fromRemote)
|
CompositeCache |
getCache(ICompositeCacheAttributes cattr)
Gets the cache attribute of the CacheHub object |
CompositeCache |
getCache(ICompositeCacheAttributes cattr,
IElementAttributes attr)
If the cache is created the CacheAttributes and the element Attributes will be ignored. |
CompositeCache |
getCache(java.lang.String cacheName)
Gets the cache attribute of the CacheHub object |
CompositeCache |
getCache(java.lang.String cacheName,
ICompositeCacheAttributes cattr)
Gets the cache attribute of the CacheHub object |
CompositeCache |
getCache(java.lang.String cacheName,
ICompositeCacheAttributes cattr,
IElementAttributes attr)
Gets the cache attribute of the CacheHub object |
java.lang.String[] |
getCacheNames()
Returns a list of the current cache names. |
int |
getCacheType()
|
ICompositeCacheAttributes |
getDefaultCacheAttributes()
Gets the defaultCacheAttributes attribute of the CacheHub object |
ICompositeCacheAttributes |
getDefaultCattr()
|
IElementAttributes |
getDefaultElementAttributes()
Gets the defaultElementAttributes attribute of the CacheHub object |
static CompositeCacheManager |
getInstance()
Gets the CacheHub instance. |
static CompositeCacheManager |
getInstance(java.lang.String propsFilename)
Initializes the cache manager using the props file for the given name. |
ICacheStats[] |
getStatistics()
This returns data gathered for all regions and all the auxiliaries they currently uses. |
java.lang.String |
getStats()
Gets stats for debugging. |
static CompositeCacheManager |
getUnconfiguredInstance()
Get a CacheHub instance which is not configured. |
protected void |
incrementClients()
|
void |
registerShutdownObserver(IShutdownObserver observer)
Perhaps the composite cache itself should be the observable object. |
void |
release()
|
void |
setDefaultCacheAttributes(ICompositeCacheAttributes icca)
Sets the defaultCacheAttributes attribute of the CacheHub object |
void |
setDefaultElementAttributes(IElementAttributes iea)
Sets the defaultElementAttributes attribute of the CacheHub object |
void |
shutDown()
Calls freeCache on all regions |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Hashtable caches
protected java.util.Hashtable systemCaches
protected ICompositeCacheAttributes defaultCacheAttr
protected IElementAttributes defaultElementAttr
protected java.util.Hashtable auxFacs
protected java.util.Hashtable auxAttrs
protected java.util.Properties props
protected java.lang.String defaultAuxValues
protected static CompositeCacheManager instance
Constructor Detail |
public CompositeCacheManager()
Method Detail |
public static CompositeCacheManager getInstance()
getUnconfiguredInstance()
and then call configure()
public static CompositeCacheManager getInstance(java.lang.String propsFilename)
propsFilename
-
public static CompositeCacheManager getUnconfiguredInstance()
protected static CompositeCacheManager createInstance()
public void configure()
public void configure(java.lang.String propFile)
propFile
- Path within classpath to load configuration frompublic void configure(java.util.Properties props)
This method will call confiure, instructing it to use ssytem properties as a default.
props
- public void configure(java.util.Properties props, boolean useSystemProperties)
You can override a specif value by passing in a ssytem property:
For example, you could override this value in the cache.ccf file by starting up your program with the argument: -Djcs.auxiliary.LTCP.attributes.TcpListenerPort=1111
props
- useSystemProperties
- --
if true, values starting with jcs will be put into the props
file prior to configuring the cache.public ICompositeCacheAttributes getDefaultCacheAttributes()
public void setDefaultCacheAttributes(ICompositeCacheAttributes icca)
icca
- The new defaultCacheAttributes valuepublic void setDefaultElementAttributes(IElementAttributes iea)
iea
- The new defaultElementAttributes valuepublic IElementAttributes getDefaultElementAttributes()
public CompositeCache getCache(java.lang.String cacheName)
getCache
in interface ICompositeCacheManager
cacheName
-
public CompositeCache getCache(java.lang.String cacheName, ICompositeCacheAttributes cattr)
cacheName
- cattr
-
public CompositeCache getCache(java.lang.String cacheName, ICompositeCacheAttributes cattr, IElementAttributes attr)
cacheName
- cattr
- attr
-
public CompositeCache getCache(ICompositeCacheAttributes cattr)
cattr
-
public CompositeCache getCache(ICompositeCacheAttributes cattr, IElementAttributes attr)
Overriding hte default elemental atributes will require cahnging the way the atributes are assigned to elements. Get cache creates a cache with defaults if none are specified. We might want to create separate method for creating/getting. . .
cattr
- attr
-
public void freeCache(java.lang.String name)
name
- public void freeCache(java.lang.String name, boolean fromRemote)
name
- fromRemote
- public void shutDown()
protected void incrementClients()
public void release()
public java.lang.String[] getCacheNames()
public int getCacheType()
public ICompositeCacheAttributes getDefaultCattr()
public java.lang.String getStats()
public ICacheStats[] getStatistics()
public void registerShutdownObserver(IShutdownObserver observer)
registerShutdownObserver
in interface IShutdownObservable
observer
- public void deregisterShutdownObserver(IShutdownObserver observer)
IShutdownObservable
deregisterShutdownObserver
in interface IShutdownObservable
observer
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |