org.apache.tomcat.util.buf

Class TimeStamp

public final class TimeStamp extends Object implements Serializable

Main tool for object expiry. Marks creation and access time of an "expirable" object, and extra properties like "id", "valid", etc. Used for objects that expire - originally Sessions, but also Contexts, Servlets, cache - or any other object that expires.

Author: Costin Manolache

Constructor Summary
TimeStamp()
Method Summary
longgetCreationTime()
intgetId()
Each object can have an unique id, similar with name but providing faster access ( array vs. hashtable lookup )
longgetLastAccessedTime()
longgetMaxInactiveInterval()
Inactive interval in millis - the time is computed in millis, convert to secs in the upper layer
MessageBytesgetName()
Return the "name" of the timestamp.
ObjectgetParent()
longgetThisAccessedTime()
booleanisNew()
booleanisValid()
voidrecycle()
voidsetCreationTime(long time)
voidsetId(int id)
voidsetMaxInactiveInterval(long interval)
voidsetNew(boolean isNew)
voidsetParent(Object o)
Returns the owner of this stamp ( the object that is time-stamped ).
voidsetValid(boolean isValid)
voidtouch(long time)
Access notification.

Constructor Detail

TimeStamp

public TimeStamp()

Method Detail

getCreationTime

public long getCreationTime()

getId

public int getId()
Each object can have an unique id, similar with name but providing faster access ( array vs. hashtable lookup )

getLastAccessedTime

public long getLastAccessedTime()

getMaxInactiveInterval

public long getMaxInactiveInterval()
Inactive interval in millis - the time is computed in millis, convert to secs in the upper layer

getName

public MessageBytes getName()
Return the "name" of the timestamp. This can be used to associate unique identifier with each timestamped object. The name is a MessageBytes - i.e. a modifiable byte[] or char[].

getParent

public Object getParent()

getThisAccessedTime

public long getThisAccessedTime()

isNew

public boolean isNew()

isValid

public boolean isValid()

recycle

public void recycle()

setCreationTime

public void setCreationTime(long time)

setId

public void setId(int id)

setMaxInactiveInterval

public void setMaxInactiveInterval(long interval)

setNew

public void setNew(boolean isNew)

setParent

public void setParent(Object o)
Returns the owner of this stamp ( the object that is time-stamped ). For a

setValid

public void setValid(boolean isValid)

touch

public void touch(long time)
Access notification. This method takes a time parameter in order to allow callers to efficiently manage expensive calls to System.currentTimeMillis()
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.