Methods Summary |
---|
public java.lang.Object | get(java.lang.String key)Get a property from the session
if (rep == null)
return null;
lastTouched = System.currentTimeMillis();
return rep.get(key);
|
public java.util.Enumeration | getKeys()Get an enumeration of the keys in this session
if (rep != null)
return rep.keys();
return null;
|
public long | getLastAccessTime()
return lastTouched;
|
public synchronized java.lang.Object | getLockObject()Get an Object suitable for synchronizing the session. This method
exists because different session implementations might provide
different ways of getting at shared data. For a simple hashtable-
based session, this would just be the hashtable, but for sessions
which use database connections, etc. it might be an object wrapping
a table ID or somesuch.
if (rep == null) {
rep = new Hashtable();
}
return rep;
|
public int | getTimeout()
return timeout;
|
public void | invalidate()invalidate the session
rep = null;
lastTouched = System.currentTimeMillis();
timeout = -1;
|
public void | remove(java.lang.String key)Remove a property from the session
if (rep != null)
rep.remove(key);
lastTouched = System.currentTimeMillis();
|
public void | set(java.lang.String key, java.lang.Object value)Set a property in the session
synchronized (this) {
if (rep == null)
rep = new Hashtable();
}
lastTouched = System.currentTimeMillis();
rep.put(key, value);
|
public void | setTimeout(int timeout)Set the session's time-to-live.
This is implementation-specific, but basically should be the #
of seconds of inactivity which will cause the session to time
out and invalidate. "inactivity" is implementation-specific.
this.timeout = timeout;
|
public void | touch()"Touch" the session (mark it recently used)
lastTouched = System.currentTimeMillis();
|