Class SynchronizedCache
- java.lang.Object
-
- com.sun.gjc.spi.base.datastructure.SynchronizedCache
-
-
Constructor Summary
Constructors Constructor Description SynchronizedCache(Cache cacheImpl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToCache(CacheObjectKey key, Object entry, boolean force)Add key and entry value into the cache.ObjectcheckAndUpdateCache(CacheObjectKey key)Check if an entry is found for this key object.voidclearCache()Clear statement cachevoidflushCache()Closing all statements in statement cache and flush the statement cache of all the statements.intgetSize()Get the size of statement cachebooleanisSynchronized()Check if the statement cache is synchronized.voidpurge()Remove all statements stored in the statement cache after closing the statement objects.voidpurge(Object entry)Remove the specified entry stored in the statement cache after closing the statement object associated with this entry.
-
-
-
Constructor Detail
-
SynchronizedCache
public SynchronizedCache(Cache cacheImpl)
-
-
Method Detail
-
checkAndUpdateCache
public Object checkAndUpdateCache(CacheObjectKey key)
Description copied from interface:CacheCheck if an entry is found for this key object. If found, the entry is put in the result object and back into the list.- Specified by:
checkAndUpdateCachein interfaceCache- Parameters:
key- whose mapping entry is to be checked.- Returns:
- result object that contains the key with the entry if not busy or null when (1) object not found in cache (2) object found but is busy
-
addToCache
public void addToCache(CacheObjectKey key, Object entry, boolean force)
Description copied from interface:CacheAdd key and entry value into the cache.- Specified by:
addToCachein interfaceCache- Parameters:
key- that contains the sql string and its type (PS/CS)entry- that is the wrapper of PreparedStatement or CallableStatementforce- If existing key is to be overwritten
-
clearCache
public void clearCache()
Description copied from interface:CacheClear statement cache- Specified by:
clearCachein interfaceCache
-
purge
public void purge()
Description copied from interface:CacheRemove all statements stored in the statement cache after closing the statement objects. Used when the statement cache size exceeds user defined maximum cache size.
-
getSize
public int getSize()
Description copied from interface:CacheGet the size of statement cache
-
isSynchronized
public boolean isSynchronized()
Description copied from interface:CacheCheck if the statement cache is synchronized.- Specified by:
isSynchronizedin interfaceCache- Returns:
- boolean synchronized flag.
-
flushCache
public void flushCache()
Description copied from interface:CacheClosing all statements in statement cache and flush the statement cache of all the statements. Used when a physical connection to the underlying resource manager is destroyed.- Specified by:
flushCachein interfaceCache
-
purge
public void purge(Object entry)
Description copied from interface:CacheRemove the specified entry stored in the statement cache after closing the statement object associated with this entry. Used when statement is being reclaimed and is being used for the subsequent requests from the application.
-
-