Class ElementAttributes
- All Implemented Interfaces:
- Serializable,- Cloneable,- IElementAttributes
- When the item is put into the cache, you can associate an element attributes object.
- If not attributes object is include when the element is put into the cache, then the default attributes for the region will be used.
- The element attributes can be reset. This effectively results in a retrieval followed by a put. Hence, this is the same as 1.
- See Also:
- 
Constructor SummaryConstructorsModifierConstructorDescriptionConstructor for the IElementAttributes objectprotectedConstructor for the IElementAttributes object
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddElementEventHandler(IElementEventHandler eventHandler) Adds a ElementEventHandler.voidaddElementEventHandlers(List<IElementEventHandler> eventHandlers) Sets the eventHandlers of the IElementAttributes object.clone()Clone objectlongGets the createTime attribute of the IAttributes object.Gets the elementEventHandlers.longGets the idleTime attribute of the IAttributes object.booleanYou can turn off expiration by setting this to true.booleanIs this item laterally distributable.booleanCan this item be sent to the remote cachebooleanCan this item be spooled to disklongGets the LastAccess attribute of the IAttributes object.longSets the maxLife attribute of the IAttributes object.intgetSize()Gets the size attribute of the IAttributes objectlonglongGets the time left to live of the IAttributes object.voidSets the createTime attribute of the IElementAttributes objectvoidsetIdleTime(long idle) Sets the idleTime attribute of the IAttributes object.voidsetIsEternal(boolean val) Sets the isEternal attribute of the ElementAttributes object.voidsetIsLateral(boolean val) Sets the isLateral attribute of the IElementAttributes objectvoidsetIsRemote(boolean val) Sets the isRemote attribute of the ElementAttributes objectvoidsetIsSpool(boolean val) Sets the isSpool attribute of the IElementAttributes objectvoidsetLastAccessTime(long time) only for use from test codevoidSets the LastAccessTime as now of the IElementAttributes objectvoidsetMaxLife(long mls) Sets the maxLife attribute of the IAttributes object.voidsetSize(int size) Size in bytes.voidsetTimeFactorForMilliseconds(long factor) toString()For logging and debugging the element IElementAttributes.
- 
Constructor Details- 
ElementAttributespublic ElementAttributes()Constructor for the IElementAttributes object
- 
ElementAttributesConstructor for the IElementAttributes object- Parameters:
- attr-
 
 
- 
- 
Method Details- 
setMaxLifeSets the maxLife attribute of the IAttributes object.- Specified by:
- setMaxLifein interface- IElementAttributes
- Parameters:
- mls- The new MaxLifeSeconds value
 
- 
getMaxLifeSets the maxLife attribute of the IAttributes object. How many seconds it can live after creation.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. - Specified by:
- getMaxLifein interface- IElementAttributes
- Returns:
- The MaxLifeSeconds value
 
- 
setIdleTimeSets the idleTime attribute of the IAttributes object. This is the maximum time the item can be idle in the cache, that is not accessed.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. - Specified by:
- setIdleTimein interface- IElementAttributes
- Parameters:
- idle- The new idleTime value
 
- 
setSizeSize in bytes. This is not used except in the admin pages. It will be 0 by default and is only updated when the element is serialized.- Specified by:
- setSizein interface- IElementAttributes
- Parameters:
- size- The new size value
 
- 
getSizeGets the size attribute of the IAttributes object- Specified by:
- getSizein interface- IElementAttributes
- Returns:
- The size value
 
- 
getCreateTimeGets the createTime attribute of the IAttributes object.This should 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. - Specified by:
- getCreateTimein interface- IElementAttributes
- Returns:
- The createTime value
 
- 
setCreateTimeSets the createTime attribute of the IElementAttributes object
- 
getIdleTimeGets the idleTime attribute of the IAttributes object.- Specified by:
- getIdleTimein interface- IElementAttributes
- Returns:
- The idleTime value
 
- 
getTimeToLiveSecondsGets the time left to live of the IAttributes object.This is the (max life + create time) - current time. - Specified by:
- getTimeToLiveSecondsin interface- IElementAttributes
- Returns:
- The TimeToLiveSeconds value
 
- 
getLastAccessTimeGets the LastAccess attribute of the IAttributes object.- Specified by:
- getLastAccessTimein interface- IElementAttributes
- Returns:
- The LastAccess value.
 
- 
setLastAccessTimeNowSets the LastAccessTime as now of the IElementAttributes object- Specified by:
- setLastAccessTimeNowin interface- IElementAttributes
 
- 
setLastAccessTimeonly for use from test code
- 
getIsSpoolCan this item be spooled to diskBy default this is true. - Specified by:
- getIsSpoolin interface- IElementAttributes
- Returns:
- The spoolable value
 
- 
setIsSpoolSets the isSpool attribute of the IElementAttributes objectBy default this is true. - Specified by:
- setIsSpoolin interface- IElementAttributes
- Parameters:
- val- The new isSpool value
 
- 
getIsLateralIs this item laterally distributable. Can it be sent to auxiliaries of type lateral.By default this is true. - Specified by:
- getIsLateralin interface- IElementAttributes
- Returns:
- The isLateral value
 
- 
setIsLateralSets the isLateral attribute of the IElementAttributes objectBy default this is true. - Specified by:
- setIsLateralin interface- IElementAttributes
- Parameters:
- val- The new isLateral value
 
- 
getIsRemoteCan this item be sent to the remote cache- Specified by:
- getIsRemotein interface- IElementAttributes
- Returns:
- true if the item can be sent to a remote auxiliary
 
- 
setIsRemoteSets the isRemote attribute of the ElementAttributes object- Specified by:
- setIsRemotein interface- IElementAttributes
- Parameters:
- val- The new isRemote value
 
- 
getIsEternalYou can turn off expiration by setting this to true. The max life value will be ignored.- Specified by:
- getIsEternalin interface- IElementAttributes
- Returns:
- true if the item cannot expire.
 
- 
setIsEternalSets the isEternal attribute of the ElementAttributes object. True means that the item should never expire. If can still be removed if it is the least recently used, and you are using the LRUMemory cache. it just will not be filtered for expiration by the cache hub.- Specified by:
- setIsEternalin interface- IElementAttributes
- Parameters:
- val- The new isEternal value
 
- 
addElementEventHandlerAdds a ElementEventHandler. Handler's can be registered for multiple events. A registered handler will be called at every recognized event.The alternative would be to register handlers for each event. Or maybe The handler interface should have a method to return whether it cares about certain events. - Specified by:
- addElementEventHandlerin interface- IElementAttributes
- Parameters:
- eventHandler- The ElementEventHandler to be added to the list.
 
- 
addElementEventHandlersSets the eventHandlers of the IElementAttributes object.This add the references to the local list. Subsequent changes in the caller's list will not be reflected. - Specified by:
- addElementEventHandlersin interface- IElementAttributes
- Parameters:
- eventHandlers- List of IElementEventHandler objects
 
- 
getTimeFactorForMilliseconds- Specified by:
- getTimeFactorForMillisecondsin interface- IElementAttributes
 
- 
setTimeFactorForMilliseconds- Specified by:
- setTimeFactorForMillisecondsin interface- IElementAttributes
 
- 
getElementEventHandlersGets the elementEventHandlers. Returns null if none exist. Makes checking easy.- Specified by:
- getElementEventHandlersin interface- IElementAttributes
- Returns:
- The elementEventHandlers List of IElementEventHandler objects
 
- 
toStringFor logging and debugging the element IElementAttributes.
- 
cloneDescription copied from interface:IElementAttributesClone object- Specified by:
- clonein interface- IElementAttributes
- Overrides:
- clonein class- Object
- See Also:
 
 
-