wt.team
Class TeamTemplateCache
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
wt.util.RMIServer
wt.cache.CacheManager
wt.team.TeamTemplateCache
- All Implemented Interfaces:
- CacheServer, Remote, Serializable, Unreferenced
- public class TeamTemplateCache
- extends CacheManager
This class implements a TeamTemplate cache service. It follows the 2-level cache paradigm.
Creation and updates to TeamTemplate must be communicated to the cache by the
Services manager.
- See Also:
- Serialized Form
Constructor Summary |
TeamTemplateCache()
Do not directly invoke this constructor! Use getTeamTemplateCache instead. |
Methods inherited from class wt.cache.CacheManager |
checkAccess, get, getDefaultName, getEntry, isCacheHost, overflow, ping, put, putEntry, reference, registerSlave, remove, remove, removeEntry, unreferenced, update, updateEntry, updateEntry |
Methods inherited from class wt.util.RMIServer |
clone, exportObject, exportObject, exportObject, getClientSocketFactory, getPort, getServerSocketFactory, getStub, isHostInList, isLocalHost, setPort, writeReplace |
versionID
private static final String versionID
- See Also:
- Constant Field Values
templatesByOID
private static TeamTemplateCache.CachedTeamTemplates templatesByOID
templatesByName
private static TeamTemplateCache.CachedTeamTemplates templatesByName
teamTemplateCache
private static volatile TeamTemplateCache teamTemplateCache
VERBOSE
private static final boolean VERBOSE
CACHESIZE
private static int CACHESIZE
CACHE_ENABLED
private static boolean CACHE_ENABLED
overflowed
private static boolean overflowed
lock
private static Object lock
ENABLED_ONLY
private static final boolean ENABLED_ONLY
SEPARATOR
private static final String SEPARATOR
- See Also:
- Constant Field Values
TeamTemplateCache
public TeamTemplateCache()
throws RemoteException
- Do not directly invoke this constructor! Use getTeamTemplateCache instead.
The constructor is public so that the ServerManager can create an instance of this
class for use as the master cache.
However, since the master cache is only being used to signal slave caches, we don't
want to construct any of the internal cache objects.
getTeamTemplateCache
protected static TeamTemplateCache getTeamTemplateCache()
getTeamTemplateReference
public TeamTemplateReference getTeamTemplateReference(WTContainerRef containerRef,
String teamName)
getTeamTemplate
public TeamTemplate getTeamTemplate(TeamTemplateReference ttr)
removeEntry
protected void removeEntry(Object a_msg)
- Description copied from class:
CacheManager
- Protected method which allows subclasses of CacheManager to
take some action when a entry is being removed from the local cache.
This method is invoked to remove the entry in the local cache as a result
of a local
remove
call or a call forwarded from a master cache.
If this cache has a master cache, the remove
call will already
be forwarded to the master before this method is invoked. Slave caches
will be notified to remove their entries after this method returns.
This method must not cause a recursive remove
call.
This method is not called when entries are being removed by the overflow
or reset
methods.
Supported API: true
- Overrides:
removeEntry
in class CacheManager
- Parameters:
a_msg
- the key object (null = clear entire cache)
putEntry
public void putEntry(Object key,
Object value)
- Description copied from class:
CacheManager
- Protected method which allows subclasses of CacheManager to
take some action when a new entry is being put into the local cache.
This method is invoked to put the entry in the local cache as a result
of a local
put
call or a call forwarded from a slave cache
or when a local get
call downloads the entry from a master cache.
If this cache has a master cache, the put
call will already
be forwarded to the master before this method is invoked. Slave caches
will be notified to remove their entries after this method returns.
This method must not cause a recursive put
call.
Supported API: true
- Overrides:
putEntry
in class CacheManager
- Parameters:
key
- the key objectvalue
- the value object
getDefaultSize
public int getDefaultSize()
- Description copied from class:
CacheManager
- Get desired size of this cache.
This method attemps to find a size property called
wt.cache.size.CacheName
where cacheName
is the name of this cache. Subclasses can override this
method to control cache size in some other way. If no property is found, the default
size is 100.
Supported API: true
- Overrides:
getDefaultSize
in class CacheManager
getEntries
public Enumeration getEntries(WTContainerRef cRef)
throws WTException
- Return a sorted enumeration of all TeamTemplates
- Throws:
WTException
populateCache
protected void populateCache()
throws WTException
- Throws:
WTException
update
public void update(TeamTemplate template,
String action)
reset
public void reset()
- Method called when connection to master cache is broken and recovered
indicating that a notification from another template cache might have been missed.
The current cache is cleared and reinitialized.
- Overrides:
reset
in class CacheManager
Print
public void Print()
isValid
private static boolean isValid()
main
public static void main(String[] args)
getKey
private String getKey(WTContainerRef container,
String templateIdentity)