|
Openfire 3.4.3 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.util.cache.CacheFactory
public class CacheFactory
Creates Cache objects. The returned caches will either be local or clustered depending on the clustering enabled setting and a user's license.
When clustered caching is turned on, cache usage statistics for all caches that have been created are periodically published to the clustered cache named "opt-$cacheStats".
Field Summary | |
---|---|
static String |
CLUSTERED_CACHE_PROPERTY_NAME
|
static long |
DEFAULT_MAX_CACHE_LIFETIME
|
static int |
DEFAULT_MAX_CACHE_SIZE
|
static String |
LOCAL_CACHE_PROPERTY_NAME
|
Method Summary | ||
---|---|---|
static void |
clearCaches()
|
|
static
|
createCache(String name)
Returns the named cache, creating it as necessary. |
|
static void |
destroyCache(String name)
Destroys the cache for the cache name specified. |
|
static void |
doClusterTask(ClusterTask task)
Invokes a task on other cluster members in an asynchronous fashion. |
|
static void |
doClusterTask(ClusterTask task,
byte[] nodeID)
Invokes a task on a given cluster member in an asynchronous fashion. |
|
static Collection<Object> |
doSynchronousClusterTask(ClusterTask task,
boolean includeLocalMember)
Invokes a task on other cluster members synchronously and returns the result as a Collection (method will not return until the task has been executed on each cluster member). |
|
static Object |
doSynchronousClusterTask(ClusterTask task,
byte[] nodeID)
Invokes a task on a given cluster member synchronously and returns the result of the remote operation. |
|
static Cache[] |
getAllCaches()
Returns an array of all caches in the system. |
|
static String |
getCacheTypeProperty(String cacheName)
|
|
static byte[] |
getClusterMemberID()
Returns a byte[] that uniquely identifies this member within the cluster or null when not in a cluster. |
|
static Collection<ClusterNodeInfo> |
getClusterNodesInfo()
Returns basic information about the current members of the cluster or an empty collection if not running in a cluster. |
|
static long |
getMaxCacheLifetime(String cacheName)
If a local property is found for the supplied name which specifies a value for cache entry lifetime, it is returned. |
|
static long |
getMaxCacheSize(String cacheName)
If a local property is found for the supplied name which specifies a value for cache size, it is returned. |
|
static int |
getMaxClusterNodes()
Returns the maximum number of cluster members allowed. |
|
static long |
getMinCacheSize(String cacheName)
|
|
static byte[] |
getSeniorClusterMemberID()
Returns a byte[] that uniquely identifies this senior cluster member or null when not in a cluster. |
|
static boolean |
hasMaxLifetimeFromProperty(String cacheName)
|
|
static boolean |
hasMaxSizeFromProperty(String cacheName)
|
|
static void |
initialize()
|
|
static boolean |
isClusteringAvailable()
Returns true if clustering is installed and can be used by this JVM to join a cluster. |
|
static boolean |
isClusteringStarted()
Returns true if this node is currently a member of a cluster. |
|
static boolean |
isClusteringStarting()
Returns true is clustering is currently being started. |
|
static boolean |
isSeniorClusterMember()
Returns true if this member is the senior member in the cluster. |
|
static void |
joinedCluster()
Notification message indicating that this JVM has joined a cluster. |
|
static void |
leftCluster()
Notification message indicating that this JVM has left the cluster. |
|
static void |
lockKey(Object key,
long timeout)
|
|
static void |
setCacheTypeProperty(String cacheName,
String type)
|
|
static void |
setMaxLifetimeProperty(String cacheName,
long lifetime)
Sets a local property which overrides the maximum cache entry lifetime as configured in coherence-cache-config.xml for the supplied cache name. |
|
static void |
setMaxSizeProperty(String cacheName,
long size)
Sets a local property which overrides the maximum cache size as configured in coherence-cache-config.xml for the supplied cache name. |
|
static void |
setMinCacheSize(String cacheName,
long size)
|
|
static void |
startClustering()
|
|
static void |
stopClustering()
|
|
static void |
unlockKey(Object key)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static String LOCAL_CACHE_PROPERTY_NAME
public static String CLUSTERED_CACHE_PROPERTY_NAME
public static final int DEFAULT_MAX_CACHE_SIZE
public static final long DEFAULT_MAX_CACHE_LIFETIME
Method Detail |
---|
public static long getMaxCacheSize(String cacheName)
cacheName
- the name of the cache to look up a corresponding property for.
public static void setMaxSizeProperty(String cacheName, long size)
cacheName
- the name of the cache to store a value for.size
- the maximum cache size.public static boolean hasMaxSizeFromProperty(String cacheName)
public static long getMaxCacheLifetime(String cacheName)
cacheName
- the name of the cache to look up a corresponding property for.
public static void setMaxLifetimeProperty(String cacheName, long lifetime)
cacheName
- the name of the cache to store a value for.lifetime
- the maximum cache entry lifetime.public static boolean hasMaxLifetimeFromProperty(String cacheName)
public static void setCacheTypeProperty(String cacheName, String type)
public static String getCacheTypeProperty(String cacheName)
public static void setMinCacheSize(String cacheName, long size)
public static long getMinCacheSize(String cacheName)
public static Cache[] getAllCaches()
public static <T extends Cache> T createCache(String name)
name
- the name of the cache to create.
public static void destroyCache(String name)
name
- the name of the cache to destroy.public static void lockKey(Object key, long timeout)
public static void unlockKey(Object key)
public static boolean isClusteringAvailable()
public static boolean isClusteringStarting()
public static boolean isClusteringStarted()
public static byte[] getClusterMemberID()
public static void clearCaches()
public static byte[] getSeniorClusterMemberID()
public static boolean isSeniorClusterMember()
public static Collection<ClusterNodeInfo> getClusterNodesInfo()
public static int getMaxClusterNodes()
public static void doClusterTask(ClusterTask task)
task
- the task to be invoked on all other cluster members.public static void doClusterTask(ClusterTask task, byte[] nodeID)
task
- the task to be invoked on the specified cluster member.nodeID
- the byte array that identifies the target cluster member.
IllegalStateException
- if requested node was not found or not running in a cluster.public static Collection<Object> doSynchronousClusterTask(ClusterTask task, boolean includeLocalMember)
task
- the ClusterTask object to be invoked on all other cluster members.includeLocalMember
- true to run the task on the local member, false otherwise
public static Object doSynchronousClusterTask(ClusterTask task, byte[] nodeID)
task
- the ClusterTask object to be invoked on a given cluster member.nodeID
- the byte array that identifies the target cluster member.
IllegalStateException
- if requested node was not found or not running in a cluster.public static void initialize() throws InitializationException
InitializationException
public static void startClustering()
public static void stopClustering()
public static void joinedCluster()
public static void leftCluster()
|
Openfire 3.4.3 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |