|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for cache element attributes classes. Every item is the cache is associated with an element attributes object. It is used to track the life of the object as well as to restrict its behavior. By default, elements get a clone of the region's attributes.
Method Summary | |
void |
addElementEventHandler(IElementEventHandler eventHandler)
Adds a ElementEventHandler. |
void |
addElementEventHandlers(java.util.ArrayList eventHandlers)
Sets the eventHandlers of the IElementAttributes object |
IElementAttributes |
copy()
Returns a copy of the object. |
long |
getCreateTime()
Gets the createTime attribute of the IAttributes object. |
java.util.ArrayList |
getElementEventHandlers()
Gets the elementEventHandlers. |
long |
getIdleTime()
Gets the idleTime attribute of the IAttributes object |
boolean |
getIsEternal()
This turns off expiration if it is true. |
boolean |
getIsLateral()
Is this item laterally distributable. |
boolean |
getIsRemote()
Can this item be sent to the remote cache. |
boolean |
getIsSpool()
Can this item be spooled to disk |
long |
getLastAccessTime()
Gets the LastAccess attribute of the IAttributes object. |
long |
getMaxLifeSeconds()
Sets the maxLife attribute of the IAttributes object. |
int |
getSize()
Gets the size attribute of the IAttributes object |
long |
getTimeToLiveSeconds()
Gets the time left to live of the IAttributes object. |
long |
getVersion()
Gets the version attribute of the IAttributes object |
void |
setIdleTime(long idle)
Sets the idleTime attribute of the IAttributes object. |
void |
setIsEternal(boolean val)
Sets the isEternal attribute of the IElementAttributes object |
void |
setIsLateral(boolean val)
Sets the isLateral attribute of the IElementAttributes object |
void |
setIsRemote(boolean val)
Sets the isRemote attribute of the IElementAttributes object. |
void |
setIsSpool(boolean val)
Sets the isSpool attribute of the IElementAttributes object |
void |
setLastAccessTimeNow()
Sets the LastAccessTime as now of the IElementAttributes object |
void |
setMaxLifeSeconds(long mls)
Sets the maxLife attribute of the IAttributes object. |
void |
setSize(int size)
Size in bytes. |
void |
setVersion(long version)
Sets the version attribute of the IAttributes object |
Method Detail |
public void setVersion(long version)
version
- The new version valuepublic void setMaxLifeSeconds(long mls)
mls
- The new MaxLifeSeconds valuepublic long getMaxLifeSeconds()
If this is exceeded the element will not be returned, instead it will be removed. It will be removed on retrieval, or removed actively if the memory shrinker is turned on.
public void setIdleTime(long idle)
If this is exceeded the element will not be returned, instead it will be removed. It will be removed on retrieval, or removed actively if the memory shrinker is turned on.
idle
- The new idleTime valuepublic void setSize(int size)
size
- The new size valuepublic int getSize()
public long getCreateTime()
This shoudd be the current time in milliseconds returned by the sysutem call when the element is put in the cache.
Putting an item in the cache overrides any existing items.
public long getLastAccessTime()
public void setLastAccessTimeNow()
public long getVersion()
public long getIdleTime()
public long getTimeToLiveSeconds()
This is the (max life + create time) - current time.
public IElementAttributes copy()
public boolean getIsSpool()
By default this is true.
public void setIsSpool(boolean val)
By default this is true.
val
- The new isSpool valuepublic boolean getIsLateral()
By default this is true.
public void setIsLateral(boolean val)
By default this is true.
val
- The new isLateral valuepublic boolean getIsRemote()
By default this is true.
public void setIsRemote(boolean val)
By default this is true.
val
- The new isRemote valuepublic boolean getIsEternal()
public void setIsEternal(boolean val)
val
- The new isEternal valuepublic void addElementEventHandler(IElementEventHandler eventHandler)
eventHandler
- The feature to be added to the ElementEventHandlerpublic java.util.ArrayList getElementEventHandlers()
Event handlers are transient. The only events defined are in memory events. All handlers are lost if the item goes to disk.
public void addElementEventHandlers(java.util.ArrayList eventHandlers)
eventHandlers
- value
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |