Top Description Fields Constructors Methods
org.glassfish.grizzly.http.util

public final Class TimeStamp

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.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

Field Summary

Modifier and TypeField and Description
private long
pack-priv int
private boolean
private boolean
private long
private long
pack-priv MessageBytes
pack-priv Object
private long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public long
public int
getId()

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

public long
public long
getMaxInactiveInterval()

Inactive interval in millis - the time is computed in millis, convert to secs in the upper layer

public MessageBytes
getName()

Return the "name" of the timestamp.

public Object
public boolean
public boolean
public void
public void
setCreationTime(long time)

public void
setId(int id)

public void
setMaxInactiveInterval(long interval)

public void
setNew(boolean isNew)

public void
setParent(Object o)

Returns the owner of this stamp ( the object that is time-stamped ).

public void
setValid(boolean isValid)

public void
touch(long time)

Access notification.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

creationTimeback to summary
private long creationTime
idback to summary
pack-priv int id
isNewback to summary
private boolean isNew
isValidback to summary
private boolean isValid
lastAccessedTimeback to summary
private long lastAccessedTime
maxInactiveIntervalback to summary
private long maxInactiveInterval
nameback to summary
pack-priv MessageBytes name
parentback to summary
pack-priv Object parent
thisAccessedTimeback to summary
private long thisAccessedTime

Constructor Detail

TimeStampback to summary
public TimeStamp()

Method Detail

getCreationTimeback to summary
public long getCreationTime()
getIdback to summary
public int getId()

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

getLastAccessedTimeback to summary
public long getLastAccessedTime()
getMaxInactiveIntervalback to summary
public long getMaxInactiveInterval()

Inactive interval in millis - the time is computed in millis, convert to secs in the upper layer

getNameback to summary
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[].

getParentback to summary
public Object getParent()
isNewback to summary
public boolean isNew()
isValidback to summary
public boolean isValid()
recycleback to summary
public void recycle()
setCreationTimeback to summary
public void setCreationTime(long time)
setIdback to summary
public void setId(int id)
setMaxInactiveIntervalback to summary
public void setMaxInactiveInterval(long interval)
setNewback to summary
public void setNew(boolean isNew)
setParentback to summary
public void setParent(Object o)

Returns the owner of this stamp ( the object that is time-stamped ). For a

setValidback to summary
public void setValid(boolean isValid)
touchback to summary
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()