wt.calendar
Class WTCalendarCache

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended bywt.util.RMIServer
              extended bywt.cache.CacheManager
                  extended bywt.calendar.WTCalendarCache
All Implemented Interfaces:
CacheServer, Remote, Serializable, Unreferenced

public class WTCalendarCache
extends CacheManager

This class implements a calendar cache service. There are different values for each type of key: CALENDAR expects a WTCalendar CALENDAR_COMPONENTS expects a QueryResult WORKING_DAYS expects an Integer WORKING_PERIODS expects an Integer

See Also:
Serialized Form

Field Summary
private static int cacheHits
           
private static int cacheSummaryInterval
           
(package private)  Cache calendars
           
(package private)  Object lock
           
(package private)  int size
           
protected static boolean STACKTRACE
           
protected static boolean VERBOSE
           
private static String versionID
           
(package private)  Cache wdCache
           
(package private)  Cache wpCache
           
 
Fields inherited from class wt.cache.CacheManager
MASTER
 
Fields inherited from class wt.util.RMIServer
csf, ssf
 
Fields inherited from class java.rmi.server.RemoteServer
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
WTCalendarCache()
          Contruct a new calendar cache.
 
Method Summary
 Object get(StartEndKey key)
          Cover method for CacheManager get that tests for a set of keys refering to the same object
 int getDefaultSize()
          Get desired size of this cache.
protected  void overflow(Object key, Object value)
          overide super.overflow to caputure overflow occurences and clean up supporting caches
 void put(StartEndKey key, Object value)
           
protected  void remove(long pid)
           
protected  void remove(StartEndKey key)
           
protected  void removeEntry(Object target)
          Simply clear local cache when signalled.
private  void reportCacheStats()
           
 void reset()
          Reset local cache after master reconnect.
 
Methods inherited from class wt.cache.CacheManager
checkAccess, get, getDefaultName, getEntry, isCacheHost, ping, put, putEntry, 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
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

lock

Object lock

size

int size

calendars

Cache calendars

wdCache

Cache wdCache

wpCache

Cache wpCache

cacheSummaryInterval

private static int cacheSummaryInterval

cacheHits

private static int cacheHits

VERBOSE

protected static boolean VERBOSE

STACKTRACE

protected static boolean STACKTRACE
Constructor Detail

WTCalendarCache

public WTCalendarCache()
                throws RemoteException
Contruct a new calendar cache.

Method Detail

overflow

protected void overflow(Object key,
                        Object value)
overide super.overflow to caputure overflow occurences and clean up supporting caches

Overrides:
overflow in class CacheManager

remove

protected void remove(long pid)

remove

protected void remove(StartEndKey key)

removeEntry

protected void removeEntry(Object target)
Simply clear local cache when signalled. It will be repopulated on subsequent requests

Overrides:
removeEntry in class CacheManager
Parameters:
target - the key object (null = clear entire cache)

reportCacheStats

private void reportCacheStats()

get

public Object get(StartEndKey key)
Cover method for CacheManager get that tests for a set of keys refering to the same object


put

public void put(StartEndKey key,
                Object value)

reset

public void reset()
           throws RemoteException
Description copied from class: CacheManager
Reset local cache after master reconnect. Called after recovery from communication failure when a connection to a new master has been established. The current cache contents are cleared and the local cache is registered as a slave of the new master.

NOTE: This may be called as a result of calling other cache updating operations since that is when the disconnect and reconnect may take place. When this happens, this method is called before the other methods return.

Supported API: true

Overrides:
reset in class CacheManager
Throws:
RemoteException

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