|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jcs.engine.ElementAttributes
Element attribute descriptor class.
Field Summary | |
long |
createTime
The creation time |
java.util.ArrayList |
eventHandlers
The list of Event handlers to use. |
long |
idle
Description of the Field |
boolean |
IS_ETERNAL
can turn off expiration |
boolean |
IS_LATERAL
Is this item laterally distributable |
boolean |
IS_REMOTE
Can this item be sent to the remote cache |
boolean |
IS_SPOOL
can this item be flushed to disk |
long |
lastAccessTime
The last access time |
long |
mls
Max life seconds |
int |
size
The byte size of teh field. |
long |
version
Description of the Field |
Constructor Summary | |
ElementAttributes()
Constructor for the IElementAttributes object |
Method Summary | |
void |
addElementEventHandler(IElementEventHandler eventHandler)
Adds a ElementEventHandler. |
void |
addElementEventHandlers(java.util.ArrayList eventHandlers)
Sets the eventHandlers of the IElementAttributes object |
java.lang.Object |
clone2()
Deep clone the attributes. |
IElementAttributes |
copy()
Copies the attributes, including references to event handlers. |
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()
can turn off expiration |
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 |
setCreateTime()
Sets the createTime attribute of the IElementAttributes object |
void |
setIdleTime(long idle)
Sets the idleTime attribute of the IAttributes object. |
void |
setIsEternal(boolean val)
Sets the isEternal attribute of the ElementAttributes object |
void |
setIsLateral(boolean val)
Sets the isLateral attribute of the IElementAttributes object |
void |
setIsRemote(boolean val)
Sets the isRemote attribute of the ElementAttributes 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 |
java.lang.String |
toString()
For logging and debugging the element IElementAttributes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public boolean IS_SPOOL
public boolean IS_LATERAL
public boolean IS_REMOTE
public boolean IS_ETERNAL
public long version
public long mls
public long idle
public int size
public long createTime
public long lastAccessTime
public transient java.util.ArrayList eventHandlers
Constructor Detail |
public ElementAttributes()
Method Detail |
public IElementAttributes copy()
copy
in interface IElementAttributes
public java.lang.Object clone2()
public void setVersion(long version)
IElementAttributes
setVersion
in interface IElementAttributes
version
- The new version valuepublic void setMaxLifeSeconds(long mls)
IElementAttributes
setMaxLifeSeconds
in interface IElementAttributes
mls
- The new MaxLifeSeconds valuepublic long getMaxLifeSeconds()
IElementAttributes
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.
getMaxLifeSeconds
in interface IElementAttributes
public void setIdleTime(long idle)
IElementAttributes
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.
setIdleTime
in interface IElementAttributes
idle
- The new idleTime valuepublic void setSize(int size)
IElementAttributes
setSize
in interface IElementAttributes
size
- The new size valuepublic int getSize()
IElementAttributes
getSize
in interface IElementAttributes
public long getCreateTime()
IElementAttributes
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.
getCreateTime
in interface IElementAttributes
public void setCreateTime()
public long getVersion()
IElementAttributes
getVersion
in interface IElementAttributes
public long getIdleTime()
IElementAttributes
getIdleTime
in interface IElementAttributes
public long getTimeToLiveSeconds()
IElementAttributes
This is the (max life + create time) - current time.
getTimeToLiveSeconds
in interface IElementAttributes
public long getLastAccessTime()
IElementAttributes
getLastAccessTime
in interface IElementAttributes
public void setLastAccessTimeNow()
IElementAttributes
setLastAccessTimeNow
in interface IElementAttributes
public boolean getIsSpool()
IElementAttributes
By default this is true.
getIsSpool
in interface IElementAttributes
public void setIsSpool(boolean val)
IElementAttributes
By default this is true.
setIsSpool
in interface IElementAttributes
val
- The new isSpool valuepublic boolean getIsLateral()
IElementAttributes
By default this is true.
getIsLateral
in interface IElementAttributes
public void setIsLateral(boolean val)
IElementAttributes
By default this is true.
setIsLateral
in interface IElementAttributes
val
- The new isLateral valuepublic boolean getIsRemote()
getIsRemote
in interface IElementAttributes
public void setIsRemote(boolean val)
setIsRemote
in interface IElementAttributes
val
- The new isRemote valuepublic boolean getIsEternal()
getIsEternal
in interface IElementAttributes
public void setIsEternal(boolean val)
setIsEternal
in interface IElementAttributes
val
- The new isEternal valuepublic void addElementEventHandler(IElementEventHandler eventHandler)
addElementEventHandler
in interface IElementAttributes
eventHandler
- The ElementEventHandler to be added to the list.public void addElementEventHandlers(java.util.ArrayList eventHandlers)
addElementEventHandlers
in interface IElementAttributes
eventHandlers
- valuepublic java.util.ArrayList getElementEventHandlers()
getElementEventHandlers
in interface IElementAttributes
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |