Jive Messenger 2.2.2 Javadoc

org.jivesoftware.util
Class CacheManager

java.lang.Object
  extended by org.jivesoftware.util.CacheManager

public class CacheManager
extends Object

A centralized, JVM static manager of Jive caches. Caches are essential for scalability.

Author:
Iain Shigeoka

Constructor Summary
CacheManager()
           
 
Method Summary
static Cache getCache(String name)
          Returns the cache specified by name.
static void initializeCache(String name, int defaultMaxCacheSize)
          Initialize a cache by name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheManager

public CacheManager()
Method Detail

initializeCache

public static void initializeCache(String name,
                                   int defaultMaxCacheSize)

Initialize a cache by name.

Caches require initialization before use. Be careful to initialize your cache before using it. Initializing a cache that has already been initialized once does nothing.

The cache manager will check jive module context for overriding defaultMaxCacheSize values. The property names should be "cache.name.size" where 'name' will be the same as the cache name. If the property exists, that value will be used instead of the defaultMaxCacheSize.

Parameters:
name - the name of the cache to create.
defaultMaxCacheSize - the default max size the cache can grow to, in bytes.

getCache

public static Cache getCache(String name)
Returns the cache specified by name.

Parameters:
name - the name of the cache to return.
Returns:
the cache found, or null if no cache by that name has been initialized.

Jive Messenger 2.2.2 Javadoc

Copyright © 1999-2004 Jive Software.