Novell exteNd
Director 5.2 API

com.sssw.fw.api
Interface EbiCacheManager


public interface EbiCacheManager

This provides an interface for the cache manager.


Field Summary
static String CACHE_MGR
          Cache Manager Key.
static String GLOBAL_CACHE_HOLDER_ID
          Global Cache Holder ID.
static String NAS_SERVERID_ATTR
          Attribute name from ServletContext that provides server identification information from Websphere.
static String SERVER_ID_PROPERTY
          Server ID system property name.
static String WAS_SERVERID_ATTR
          Attribute name from ServletContext that provides server identification information from Websphere.
 
Method Summary
 void enableCache(boolean doEnable)
          Enables/Disables the cache.
 void flushAll()
          Flushes the cache entries from all server-lifetime cache holders.
 void flushAll(boolean notification)
          Flushes the cache entries from all server-lifetime cache holders.
 void flushServerLifetimeCacheHolder(String cacheHolderID)
          Flushes the cache entries held by the sepcified server-lifetime cache holder.
 void flushServerLifetimeCacheHolder(String cacheHolderID, boolean notification)
          Flushes the cache entries held by the sepcified server-lifetime cache holder.
 Document getAllStatistics()
          Gets an xml Document that provides the current statistics from cache manager.
 String getCacheManagerUUID()
          Gets the Cache Manager UUID.
 EbiSrvLifetimeCacheHolder getGlobalCacheHolder()
          Gets the global server-lifetime cache holder.
 EbiRemoteCoordinatorAdmin getRemoteCoordinatorAdmin()
          Gets an EbiRemoteCoordinatorAdmin object that communicates to the cache coordinator server through rmi to retrieve information from the cache coordinator server.
 EbiSrvLifetimeCacheHolder getServerLifetimeCacheHolder(String cacheHolderID)
          Looks up a server-lifetime cache holder by its ID
 String[] getServerLifetimeCacheHolderIDList()
          Gets the list of all server lifetime cache holder IDs.
 void initialize()
          Initializes the cache manager.
 void initialize(long maxObjs)
          Initializes the cache manager from xwb.
 boolean isCacheEnabled()
          Checks to see if the cache is enabled.
 void removeServerLifetimeCacheHolder(String cacheHolderID)
          Removes a server-lifetime cache holder by its ID
 void setDiskDirectory(String dirLoc)
          Sets the disk directory.
 void setDiskMaxEntrySize(long maxEntrySize)
          Sets the maximum content size for a cache entry allowed in the disk cache.
 void setDiskMaxTotalSize(long maxDiskSize)
          Sets the total disk size used for disk cache.
 void setMemoryMaxEntrySize(long maxEntrySize)
          Sets the maximum content size for a cache entry allowed in the memory cache.
 void setMemoryMaxTotalSize(long maxMemSize)
          Sets the total memory size used for memory cache.
 void setObjectMaxTotalSize(long maxObjs)
          Sets the maximum number of objects store in the object cache.
 void setServerID(String serverID)
          Sets server ID for the server instance that this cachemgr instance is running on.
 

Field Detail

CACHE_MGR

public static final String CACHE_MGR
Cache Manager Key. Used to get the cache manager singleton from the framework factory.

GLOBAL_CACHE_HOLDER_ID

public static final String GLOBAL_CACHE_HOLDER_ID
Global Cache Holder ID. One per Eb Cache Manager.

SERVER_ID_PROPERTY

public static final String SERVER_ID_PROPERTY
Server ID system property name. This is used to allow customer set a ServerID for each app server instance and used by the cache coordinator logging.
Since:
5.0

NAS_SERVERID_ATTR

public static final String NAS_SERVERID_ATTR
Attribute name from ServletContext that provides server identification information from Websphere.
Since:
5.0

WAS_SERVERID_ATTR

public static final String WAS_SERVERID_ATTR
Attribute name from ServletContext that provides server identification information from Websphere.
Since:
5.0
Method Detail

getCacheManagerUUID

public String getCacheManagerUUID()
Gets the Cache Manager UUID.
Returns:
the uuid for the cache manager instance.

getGlobalCacheHolder

public EbiSrvLifetimeCacheHolder getGlobalCacheHolder()
Gets the global server-lifetime cache holder. (Crossing War bondary)
Returns:
the global EbiCacheHolder object.

initialize

public void initialize()
Initializes the cache manager. This call initializes the cache manager based on the properties provided in the config.xml file in the FrameworkService.jar.

initialize

public void initialize(long maxObjs)
Initializes the cache manager from xwb. This call enables the object cache container only.
Parameters:
maixObjs - maximum number of objects hold in the object cache container.

enableCache

public void enableCache(boolean doEnable)
Enables/Disables the cache.
Parameters:
doEnable - true if wants to enable the cache.

isCacheEnabled

public boolean isCacheEnabled()
Checks to see if the cache is enabled.
Returns:
true if the cache is enabled, false otherwise.

setMemoryMaxEntrySize

public void setMemoryMaxEntrySize(long maxEntrySize)
Sets the maximum content size for a cache entry allowed in the memory cache.
Parameters:
maxEntrySize - maximum entry size for memory cache.

setMemoryMaxTotalSize

public void setMemoryMaxTotalSize(long maxMemSize)
Sets the total memory size used for memory cache.
Parameters:
maxMemSize - maximum total memory size allowed for the memory cache.

setDiskMaxEntrySize

public void setDiskMaxEntrySize(long maxEntrySize)
Sets the maximum content size for a cache entry allowed in the disk cache.
Parameters:
maxEntrySize - maximum entry size for disk cache.

setDiskMaxTotalSize

public void setDiskMaxTotalSize(long maxDiskSize)
Sets the total disk size used for disk cache.
Parameters:
maxDiskSize - maximum total disk size allowed for the disk cache.

setDiskDirectory

public void setDiskDirectory(String dirLoc)
Sets the disk directory.
Parameters:
dirLoc - disk cache directory location.

setObjectMaxTotalSize

public void setObjectMaxTotalSize(long maxObjs)
Sets the maximum number of objects store in the object cache.
Parameters:
maxObjs - maximum number of objects allow to be cached in the object cache.

setServerID

public void setServerID(String serverID)
Sets server ID for the server instance that this cachemgr instance is running on.
Parameters:
serverID - a server ID.

getServerLifetimeCacheHolderIDList

public String[] getServerLifetimeCacheHolderIDList()
Gets the list of all server lifetime cache holder IDs.
Returns:
a String array of server lifetime cache holder IDs.

getServerLifetimeCacheHolder

public EbiSrvLifetimeCacheHolder getServerLifetimeCacheHolder(String cacheHolderID)
Looks up a server-lifetime cache holder by its ID
Parameters:
cacheHolderID - an ID for the specified cache holder.
Returns:
the server-lifetime cache holder with that ID or null if not found

removeServerLifetimeCacheHolder

public void removeServerLifetimeCacheHolder(String cacheHolderID)
Removes a server-lifetime cache holder by its ID
Parameters:
cacheHolderID - an ID of the cache holder to be removed.
Returns:
the server-lifetime cache holder with that ID

flushServerLifetimeCacheHolder

public void flushServerLifetimeCacheHolder(String cacheHolderID)
Flushes the cache entries held by the sepcified server-lifetime cache holder.
Parameters:
cacheHolderID - an identifier for the cache holder to be flushed

flushServerLifetimeCacheHolder

public void flushServerLifetimeCacheHolder(String cacheHolderID,
                                           boolean notification)
Flushes the cache entries held by the sepcified server-lifetime cache holder. Sends a cache invalidation to the cache coordinator to flush this cache holder from the rest servers in the cluster if the notification is set to true.
Parameters:
cacheHolderID - an identifier for the cache holder to be flushed
notification - a boolean value, if true will also notify the cache coordinator to broadcast a message to flush this cache holder from all servers in the cluster.
Since:
v5.2

flushAll

public void flushAll()
Flushes the cache entries from all server-lifetime cache holders.

flushAll

public void flushAll(boolean notification)
Flushes the cache entries from all server-lifetime cache holders. Sends a notification to the cache coordinator to broadcast a message to flush all of server-lifetime cache holders from the rest servers in the cluster.
Parameters:
notification - true if request for broadcasting, false if just flush the caches locally.
Since:
v5.2

getAllStatistics

public Document getAllStatistics()
Gets an xml Document that provides the current statistics from cache manager.
Returns:
a Document object that contains statistics info.

getRemoteCoordinatorAdmin

public EbiRemoteCoordinatorAdmin getRemoteCoordinatorAdmin()
                                                    throws EboUnrecoverableSystemException
Gets an EbiRemoteCoordinatorAdmin object that communicates to the cache coordinator server through rmi to retrieve information from the cache coordinator server.
Returns:
an EbiRemoteCoordinatorAdmin object.
Since:
5.0

Novell exteNd
Director 5.2 API