| 
 | Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
   com.tangosol.util.Base
com.tangosol.util.Base
       com.tangosol.util.AbstractKeyBasedMap
com.tangosol.util.AbstractKeyBasedMap
           com.tangosol.util.AbstractKeySetBasedMap
com.tangosol.util.AbstractKeySetBasedMap
               com.tangosol.net.cache.SerializationMap
com.tangosol.net.cache.SerializationMap
                   com.tangosol.net.cache.AbstractSerializationCache
com.tangosol.net.cache.AbstractSerializationCache
                       com.tangosol.net.cache.SerializationPagedCache
com.tangosol.net.cache.SerializationPagedCache
public class SerializationPagedCache
A version of SerializationMap that implements an LRU policy using time-based paging of the cache. This implementation uses a BinaryStoreManager to create a current BinaryStore which is used to store all objects being placed into the cache. Once the specified "current" time period has elapsed, a new current BinaryStore is created, and the previously current page is closed, which means that it will no longer be used to store objects that are being placed into the cache. This continues until the total number of pages (the one current plus all of the previously current pages) exceeds the maximum number of pages defined for the cache. When that happens, the oldest page is evicted, triggering the related events, and the BinaryStore for that page is destroyed. Note that cache items can be accessed out of and removed from closed pages, but cache items are never written to closed pages.
To avoid a massive number of simultaneous events, the eviction of a closed page can be performed asynchronously on a daemon thread.
| Nested Class Summary | |
|---|---|
| static class | SerializationPagedCache.FakeBinaryStoreA lite BinaryStore implementation used when the real underlying BinaryStore gets destroyed. | 
|  class | SerializationPagedCache.PagedBinaryStoreA virtual BinaryStore implementation that aggregates a sequence (newest to oldest) of periodic BinaryStore objects. | 
|  class | SerializationPagedCache.WrapperBinaryStoreA wrapper BinaryStore implementation that keeps track of its size. | 
| Nested classes/interfaces inherited from class com.tangosol.util.AbstractKeySetBasedMap | 
|---|
| AbstractKeySetBasedMap.EntrySet, AbstractKeySetBasedMap.KeyIterator, AbstractKeySetBasedMap.KeySet, AbstractKeySetBasedMap.ValuesCollection | 
| Nested classes/interfaces inherited from interface java.util.Map | 
|---|
| java.util.Map.Entry | 
| Constructor Summary | |
|---|---|
| SerializationPagedCache(BinaryStoreManager storemgr, int cPages, int cPageSecs)Construct a SerializationPagedCache on top of a BinaryStoreManager. | |
| SerializationPagedCache(BinaryStoreManager storemgr, int cPages, int cPageSecs, boolean fBinaryMap, boolean fPassive)Construct a SerializationPagedCache on top of a BinaryStoreManager. | |
| SerializationPagedCache(BinaryStoreManager storemgr, int cPages, int cPageSecs, java.lang.ClassLoader loader)Construct a SerializationPagedCache on top of a BinaryStoreManager. | |
| Method Summary | |
|---|---|
| protected  void | advancePage()Advance to a new current page, and deactivate the oldest page is the maximum number of active pages has been reached. | 
| protected  void | checkPage()Determine if the time has come to set up a new page for storing current cache data. | 
|  void | clear()Clear all key/value mappings. | 
| protected  BinaryStore | createBinaryStore()Create and register a new BinaryStore object, using this cache's BinaryStoreManager. | 
| protected  void | deactivatePage(SerializationPagedCache.WrapperBinaryStore store)Deactivate a page that is no longer active. | 
| protected  void | destroyBinaryStore(BinaryStore store)Destroy and unregister a BinaryStore object that was previously created using this cache's BinaryStoreManager by the createBinaryStore method. | 
| protected  void | eraseStore()Erase all entries from the underlying store. | 
|  void | evict()Flush items that have expired. | 
|  java.lang.Object | get(java.lang.Object oKey)Returns the value to which this map maps the specified key. | 
| protected  java.util.List | getBinaryStoreList()Get the list of registered BinaryStore objects. | 
| protected  BinaryStoreManager | getBinaryStoreManager()Returns the BinaryStoreManager that provides BinaryStore objects this cache uses for its storage. | 
|  XmlElement | getConfig()Determine the current configuration of the object. | 
| protected  long | getCurrentPageTime()Determine the time that the current page was created. | 
| protected  java.lang.String | getDescription()Assemble a human-readable description. | 
|  int | getLockDelaySeconds()Determine the number of seconds to wait for a lock in debug mode. | 
| protected  ConcurrentMap | getLockMap()Obtain the map used for managing key- and map-level locks to ensure data consistency. | 
|  int | getMaximumPages()Determine the maximum number of pages that the cache will manage, beyond which the oldest pages are destroyed. | 
| protected  long | getPageAdvanceTime()Determine the time that the next page should be created. | 
| protected  SerializationPagedCache.PagedBinaryStore | getPagedBinaryStore()Returns the BinaryStore that this map uses for its storage. | 
|  long | getPageDuration()Determine the length of time that the most recently created page is kept as the current page. | 
| protected  SerializationPagedCache.FakeBinaryStore | instantiateFakeBinaryStore()Factory method: Instantiate a FakeBinaryStore. | 
| protected  SerializationPagedCache.PagedBinaryStore | instantiatePagedStore(int cPages)Factory method: Instantiate a PagedBinaryStore. | 
| protected  SerializationPagedCache.WrapperBinaryStore | instantiateWrapperStore(BinaryStore store)Factory method: Instantiate a WrapperBinaryStore. | 
|  boolean | isAsynchronousPageDeactivation()Determine if a daemon should evict the items from a deactivated page to avoid blocking other work from being done. | 
| static boolean | isDebug()Determine the status of the internal debug flag. | 
|  boolean | isPassivePagedBackup()Determine if this is just a passive backup for a paged cache. | 
|  boolean | isVirtualErase()Determine if BinaryStore erase commands will be done only in memory (to the cached list of keys) and not passsed to the underlying BinaryStore, thus improving performance and cutting I/O, but potentially wasting disk space (or whatever resource the paged data are stored on.) | 
| protected  java.util.Iterator | iterateBinaryStores()Obtain an iterator of all registered (not destroyed) BinaryStore objects being used by this cache. | 
| protected  void | lockInternal(java.lang.Object oKey)Obtain a lock for the specified key. | 
| protected  boolean | lockInternalNoWait(java.lang.Object oKey)Obtain a lock for the specified key, but only if no other thread has the lock at the point in time that this method is invoked. | 
|  java.lang.Object | put(java.lang.Object oKey, java.lang.Object oValue)Associates the specified value with the specified key in this map. | 
|  void | putAll(java.util.Map map)Copies all of the mappings from the specified map to this map. | 
|  java.lang.Object | remove(java.lang.Object oKey)Removes the mapping for this key from this map if present. | 
| protected  boolean | removeBlind(java.lang.Object oKey)Removes the mapping for this key from this map if present. | 
| protected  void | runTask(java.lang.Runnable task)Run the passed task on a separate thread. | 
|  void | setAsynchronousPageDeactivation(boolean fAsync)Specify whether a daemon should evict the items from a deactivated page to avoid blocking other work from being done. | 
| protected  void | setBinaryStore(BinaryStore store)Configures the BinaryStore that this map will use for its storage. | 
|  void | setConfig(XmlElement xml)Specify the configuration for the object. | 
| static void | setDebug(boolean fDebug)Set the status of the internal debug flag. | 
|  void | setLockDelaySeconds(int cSecondsLockDelay)Specify the number of seconds to wait for a lock in debug mode. | 
| protected  void | setPageDuration(long cPageMillis)Specify the length of time that the most recently created page is kept as the current page. | 
| protected  void | setPassivePagedBackup(boolean fPassiveBackup)Specify whether this is just a passive backup for a paged cache. | 
| protected  void | setVirtualErase(boolean fVirtualErase)Specify whether BinaryStore erase commands will be done only in memory to the cached list of keys. | 
|  java.lang.String | toString()Returns a string representation of this Map. | 
| protected  void | unlockInternal(java.lang.Object oKey)Release the lock on the specified key. | 
| Methods inherited from class com.tangosol.net.cache.AbstractSerializationCache | 
|---|
| addMapListener, addMapListener, addMapListener, dispatchEvent, dispatchPendingEvent, getMapListenerSupport, hasListeners, removeMapListener, removeMapListener, removeMapListener | 
| Methods inherited from class com.tangosol.net.cache.SerializationMap | 
|---|
| containsValue, fromBinary, getBinaryStore, getCacheStatistics, getClassLoader, getInternalKeySet, getKeyMap, instantiateKeyMap, isBinaryMap, registerKey, setBinaryMap, setClassLoader, toBinary, unregisterKey | 
| Methods inherited from class com.tangosol.util.AbstractKeySetBasedMap | 
|---|
| containsKey, instantiateEntrySet, instantiateKeyIterator, instantiateKeySet, instantiateValues, isEmpty, isInternalKeySetIteratorMutable, iterateKeys, size | 
| Methods inherited from class com.tangosol.util.AbstractKeyBasedMap | 
|---|
| clone, entrySet, equals, getAll, hashCode, keySet, values | 
| Methods inherited from interface java.util.Map | 
|---|
| containsKey, containsValue, entrySet, equals, hashCode, isEmpty, keySet, size, values | 
| Constructor Detail | 
|---|
public SerializationPagedCache(BinaryStoreManager storemgr,
                               int cPages,
                               int cPageSecs)
storemgr - the BinaryStoreManager that provides BinaryStore objects that the serialized objects are written tocPages - the maximum number of pages to have active at a timecPageSecs - the length of time, in seconds, that a 'page' is current
public SerializationPagedCache(BinaryStoreManager storemgr,
                               int cPages,
                               int cPageSecs,
                               java.lang.ClassLoader loader)
storemgr - the BinaryStoreManager that provides BinaryStore objects that the serialized objects are written tocPages - the maximum number of pages to have active at a timecPageSecs - the length of time, in seconds, that a 'page' is currentloader - the ClassLoader to use for deserialization
public SerializationPagedCache(BinaryStoreManager storemgr,
                               int cPages,
                               int cPageSecs,
                               boolean fBinaryMap,
                               boolean fPassive)
storemgr - the BinaryStoreManager that provides BinaryStore objects that the serialized objects are written tocPages - the maximum number of pages to have active at a timecPageSecs - the length of time, in seconds, that a 'page' is currentfBinaryMap - true indicates that this map will only manage binary keys and valuesfPassive - true indicates that this map is a passive cache, which means that it is just a backup of the cache and does not actively expire data| Method Detail | 
|---|
public XmlElement getConfig()
public void setConfig(XmlElement xml)
xml - the XML configuration for the objectjava.lang.IllegalStateException - if the object is not in a state that allows the configuration to be set; for example, if the object has already been configured and cannot be reconfiguredpublic void clear()
clear in interface java.util.Mapclear in class AbstractSerializationCachepublic java.lang.Object get(java.lang.Object oKey)
get in interface java.util.Mapget in class SerializationMapoKey - the key object
public java.lang.Object put(java.lang.Object oKey,
                            java.lang.Object oValue)
put in interface java.util.Mapput in class AbstractSerializationCacheoKey - key with which the specified value is to be associatedoValue - value to be associated with the specified keypublic void putAll(java.util.Map map)
putAll in interface java.util.MapputAll in class AbstractSerializationCachemap - map of entries to be stored in this mappublic java.lang.Object remove(java.lang.Object oKey)
remove in interface java.util.Mapremove in class AbstractSerializationCacheoKey - key whose mapping is to be removed from the mapprotected boolean removeBlind(java.lang.Object oKey)
removeBlind in class AbstractSerializationCacheoKey - key whose mapping is to be removed from the mapprotected void eraseStore()
eraseStore in class SerializationMappublic void evict()
AsynchronousPageDeactivation property.evict in class AbstractSerializationCachepublic java.lang.String toString()
toString in class SerializationMapprotected java.lang.String getDescription()
getDescription in class AbstractSerializationCachepublic boolean isVirtualErase()
protected void setVirtualErase(boolean fVirtualErase)
fVirtualErase - true if the erase should not go to the underlying store, but simply remove the key from the cached list of keys managed by that store; false to pass all erase requests down to the underlying storepublic int getLockDelaySeconds()
public void setLockDelaySeconds(int cSecondsLockDelay)
This will not take effect until the next lock is requested and unless debug mode is turned on.
cSecondsLockDelay - the number of seconds to wait for a lockprotected ConcurrentMap getLockMap()
protected BinaryStoreManager getBinaryStoreManager()
This object is intended for use only by the createBinaryStore, and destroyBinaryStore methods.
protected void setBinaryStore(BinaryStore store)
setBinaryStore in class SerializationMapstore - the BinaryStore to useprotected SerializationPagedCache.PagedBinaryStore getPagedBinaryStore()
Note: This implementation assumes that the BinaryStore is only being modified by this Map instance. If you modify the BinaryStore contents, the behavior of this Map is undefined.
protected java.util.List getBinaryStoreList()
protected java.util.Iterator iterateBinaryStores()
public int getMaximumPages()
public long getPageDuration()
protected void setPageDuration(long cPageMillis)
cPageMillis - the time in milliseconds that a page remains currentprotected long getCurrentPageTime()
protected long getPageAdvanceTime()
public boolean isPassivePagedBackup()
protected void setPassivePagedBackup(boolean fPassiveBackup)
fPassiveBackup - true if this cache is just a backup for a paged cachepublic boolean isAsynchronousPageDeactivation()
public void setAsynchronousPageDeactivation(boolean fAsync)
This will not take effect until the next page is deactivated.
fAsync - pass true to specify that a daemon should be used for page deactivation, or false to block all other threads while a page is fully deactivatedpublic static boolean isDebug()
public static void setDebug(boolean fDebug)
fDebug - true to set the cache into debug mode, false to set it into normal runtime modeprotected void lockInternal(java.lang.Object oKey)
oKey - the key to lockprotected boolean lockInternalNoWait(java.lang.Object oKey)
oKey - the key to lockprotected void unlockInternal(java.lang.Object oKey)
oKey - the key to unlockprotected BinaryStore createBinaryStore()
protected void destroyBinaryStore(BinaryStore store)
store - a BinaryStore returned previously from createBinaryStoreprotected void checkPage()
protected void advancePage()
protected void runTask(java.lang.Runnable task)
task - the Runnable object to run on a separate threadprotected void deactivatePage(SerializationPagedCache.WrapperBinaryStore store)
store - the "page" to deactivateprotected SerializationPagedCache.PagedBinaryStore instantiatePagedStore(int cPages)
cPages - the maximum number of pages to have active at a timeprotected SerializationPagedCache.WrapperBinaryStore instantiateWrapperStore(BinaryStore store)
store - the BinaryStore to wrapprotected SerializationPagedCache.FakeBinaryStore instantiateFakeBinaryStore()
| 
 | Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||