wt.pom
Class EmptyTableManager

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended bywt.util.RMIServer
              extended bywt.cache.CacheManager
                  extended bywt.pom.EmptyTableManager
All Implemented Interfaces:
CacheServer, Remote, Serializable, Unreferenced
Direct Known Subclasses:
NoOpEmptyTableManager

public class EmptyTableManager
extends CacheManager

Provides methods to access cached empty tables information.

Supported API: false

Extendable: false

See Also:
Serialized Form

Nested Class Summary
(package private)  class EmptyTableManager.AllManagersStartedEventListener
           
(package private)  class EmptyTableManager.EmptyTablePOMOperationListener
           
 
Field Summary
private  Hashtable cache
           
private static String CLASSNAME
           
private  HashMap foreignKeyMap
           
private static Object IS_STALE
           
(package private)  boolean isPopulated
           
private static Object lock
           
private static EmptyTableManager manager
           
(package private)  boolean opEnabled
           
private static String RESOURCE
           
 
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
 
Fields inherited from interface wt.cache.CacheServer
versionID
 
Constructor Summary
EmptyTableManager()
          

Supported API: false
 
Method Summary
private  void clearStaleFlag()
          Clears a boolean flag in the MethodContext that indicates that the cache contains stale data for the current transaction
static void disable()
           
 ClassInfo[] filterEmptyTables(ClassInfo[] a_classInfos)
           
 Vector filterEmptyTables(Vector a_classInfos)
           
private  void findEmptyTables(Vector classNames)
           
private  void findNotEmptyTables(Vector classNames)
           
private  Hashtable getCache()
           
 int getDefaultSize()
          override CacheManager.getDefaultSize to return 0 since no objects will be put into the wt.util.Cache object contained in CacheManager.
static EmptyTableManager getEmptyTableManager()
          an assessor method to obtain the single instance of the EmptyTableManager.
private  void initializeForeignKeyMap()
           
private  void initializeForeignKeyMapFor(Class a_class)
           
 boolean isStale()
          Indicates if the contents of cache have been changed at some point.
 boolean isTableEmpty(ClassInfo a_classInfo)
           
 boolean isTableEmpty(Object a_className)
          method to tell if a class table is empty given class name in the form of String.
private  void populateCache()
           
 void putEntry(Object key, Object value)
          override CacheManager.putEntry to do nothing so that entries are not added to the wt.util.Cache object contained in CacheManager.
private  QueryResult queryTables(Vector classNames)
           
private  void registerAllManagersStartedEventListener()
           
private  void registerPOMOperationListener()
           
 void removeClassName(Object a_className)
          called by StandardPersistentManager to remove an entry from the cache when the insert operation is done.
protected  void removeEntry(Object key)
          override CacheManager.removeEntry to receiving the notifying classname and remove this entry from the cache.
 void reset()
          Reset local cache after master reconnect.
private  void setStaleFlag()
          Sets a boolean flag in the MethodContext that indicates that the cache contains stale data for the current transaction
private static void signalRemoteCaches(Object a_className)
          method for internal use by the method void removeClassName(Object a_className) to notify other remote caches for removing an entry given the class name.
 
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
 
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

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

cache

private Hashtable cache

foreignKeyMap

private HashMap foreignKeyMap

isPopulated

boolean isPopulated

opEnabled

boolean opEnabled

manager

private static EmptyTableManager manager

lock

private static Object lock

IS_STALE

private static final Object IS_STALE
Constructor Detail

EmptyTableManager

public EmptyTableManager()
                  throws RemoteException


Supported API: false

Method Detail

getCache

private Hashtable getCache()

populateCache

private void populateCache()
                    throws WTException
Throws:
WTException

initializeForeignKeyMap

private void initializeForeignKeyMap()
                              throws WTException
Throws:
WTException

getDefaultSize

public int getDefaultSize()
override CacheManager.getDefaultSize to return 0 since no objects will be put into the wt.util.Cache object contained in CacheManager.

Supported API: false

Overrides:
getDefaultSize in class CacheManager
Returns:
int

putEntry

public void putEntry(Object key,
                     Object value)
override CacheManager.putEntry to do nothing so that entries are not added to the wt.util.Cache object contained in CacheManager.

Supported API: false

Overrides:
putEntry in class CacheManager
Parameters:
key -
value -

removeEntry

protected void removeEntry(Object key)
override CacheManager.removeEntry to receiving the notifying classname and remove this entry from the cache.

Supported API: false

Overrides:
removeEntry in class CacheManager
Parameters:
key -

isStale

public boolean isStale()
Indicates if the contents of cache have been changed at some point.

Returns:
true if this cache has already been updated in the current transaction, otherwise false

setStaleFlag

private void setStaleFlag()
Sets a boolean flag in the MethodContext that indicates that the cache contains stale data for the current transaction


clearStaleFlag

private void clearStaleFlag()
Clears a boolean flag in the MethodContext that indicates that the cache contains stale data for the current transaction


signalRemoteCaches

private static void signalRemoteCaches(Object a_className)
method for internal use by the method void removeClassName(Object a_className) to notify other remote caches for removing an entry given the class name.

Parameters:
a_className -

isTableEmpty

public boolean isTableEmpty(Object a_className)
method to tell if a class table is empty given class name in the form of String.

Supported API: false

Parameters:
a_className -
Returns:
boolean

isTableEmpty

public boolean isTableEmpty(ClassInfo a_classInfo)

filterEmptyTables

public ClassInfo[] filterEmptyTables(ClassInfo[] a_classInfos)

filterEmptyTables

public Vector filterEmptyTables(Vector a_classInfos)

removeClassName

public void removeClassName(Object a_className)
called by StandardPersistentManager to remove an entry from the cache when the insert operation is done.

Supported API: false

Parameters:
a_className -

disable

public static void disable()
                    throws WTException
Throws:
WTException

getEmptyTableManager

public static EmptyTableManager getEmptyTableManager()
                                              throws WTException
an assessor method to obtain the single instance of the EmptyTableManager.

Supported API: false

Returns:
EmptyTablemanager
Throws:
WTException

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

queryTables

private QueryResult queryTables(Vector classNames)
                         throws PersistenceException
Throws:
PersistenceException

findEmptyTables

private void findEmptyTables(Vector classNames)
                      throws PersistenceException
Throws:
PersistenceException

findNotEmptyTables

private void findNotEmptyTables(Vector classNames)
                         throws PersistenceException
Throws:
PersistenceException

initializeForeignKeyMapFor

private void initializeForeignKeyMapFor(Class a_class)
                                 throws WTException
Throws:
WTException

registerAllManagersStartedEventListener

private void registerAllManagersStartedEventListener()

registerPOMOperationListener

private void registerPOMOperationListener()
                                   throws WTException
Throws:
WTException