wt.fc.cache
Class ReferenceCache.ObjectReferenceCacheTable

java.lang.Object
  extended bywt.fc.cache.CacheTable
      extended bywt.fc.cache.ReferenceCache.ObjectReferenceCacheTable
All Implemented Interfaces:
ApplicationContextChild
Enclosing class:
ReferenceCache

class ReferenceCache.ObjectReferenceCacheTable
extends CacheTable

An extension of CacheTable that maintains a mapping of Long oids to their corresponding cache. This is used so that the Messenger does not have to send a complete ObjectIdentifier over the wire.


Nested Class Summary
(package private)  class ReferenceCache.ObjectReferenceCacheTable.ObjectReferenceCache
           
 
Field Summary
(package private)  Map idMapping
           
(package private)  Object sharedContextKey
           
 
Fields inherited from class wt.fc.cache.CacheTable
lock, name
 
Fields inherited from interface wt.services.applicationcontext.ApplicationContextChild
APPLICATION_CONTEXT
 
Constructor Summary
(package private) ReferenceCache.ObjectReferenceCacheTable()
           
 
Method Summary
 void clear()
          Clear idMappings if the cache table gets cleared
protected  Cache createCache(String cache_name, int size, int report_interval)
          Create an extension of DirtyMap that keeps the idMapping table in sync with the cache.
(package private)  DirtyMap getDirtyMap(Long id)
          Get the DirtyMap that corresponds to the given object identifier, in Long form.
(package private)  DirtyMap getDirtyMap(String class_name)
          Get the DirtyMap that corresponds to the given object identifier
 
Methods inherited from class wt.fc.cache.CacheTable
get, getApplicationContext, getName, setApplicationContext, toString, writeContents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sharedContextKey

final Object sharedContextKey

idMapping

final Map idMapping
Constructor Detail

ReferenceCache.ObjectReferenceCacheTable

ReferenceCache.ObjectReferenceCacheTable()
Method Detail

getDirtyMap

DirtyMap getDirtyMap(Long id)
Get the DirtyMap that corresponds to the given object identifier, in Long form.


getDirtyMap

DirtyMap getDirtyMap(String class_name)
               throws WTException
Get the DirtyMap that corresponds to the given object identifier

Throws:
WTException

createCache

protected Cache createCache(String cache_name,
                            int size,
                            int report_interval)
Create an extension of DirtyMap that keeps the idMapping table in sync with the cache.

In addition, register the cache messenger as a listener for changes to the cache.

Overrides:
createCache in class CacheTable
Parameters:
cache_name - The name of the cache
size - The size of the cache
report_interval - The number of gets after which cache statistics are printed
Returns:
A method-private extension of DirtyMap

clear

public void clear()
Clear idMappings if the cache table gets cleared

Overrides:
clear in class CacheTable