com.ibm.dse.clientserver
Class CSSessionManager

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--com.ibm.dse.clientserver.CSSessionManager

public class CSSessionManager
extends java.lang.Thread

This thread has the responsability of find the expired sessions. A session is considered expired as long as has reached a timeout from its last request processed. This timeout is an attribute of the CSServer Service. The thread remains asleep during a given period of time, then performs the check. This process repeats until the stop method is called. The time that the thread will sleep is an attribute of CSServer called timeBetweenSessionCheck. When a session has expired, two actions are performed: marking it as expired, this changing the expired value of the session entry to true, and firing an CSInactivityClientEvent.


Field Summary
protected  boolean again
          Indicates the thread whether must go on performing the check or must terminate.
protected  long timeBetweenChecks
          Indicates the thread the time it must sleep between a checking and the next one.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CSSessionManager()
          ExpiredSessionsChecker constructor.
 
Method Summary
protected  boolean isAgain()
          Returns the again property value.
 void run()
          Run method of the thread.
protected  void setAgain(boolean newAgain)
          Sets the again property (boolean) value.
 void stopThread()
          Stops the thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

timeBetweenChecks

protected long timeBetweenChecks
Indicates the thread the time it must sleep between a checking and the next one.

again

protected boolean again
Indicates the thread whether must go on performing the check or must terminate.
Constructor Detail

CSSessionManager

public CSSessionManager()
ExpiredSessionsChecker constructor. Gets the timeBetweenSessionCheck value from the CSServerService, which is chained to the root context.
Method Detail

isAgain

protected boolean isAgain()
Returns the again property value.
Returns:
boolean

run

public void run()
Run method of the thread. Sleeps for a given time (set in the CSServerService) and calls the Context.checkExpiredSessions method, which will look for expired sessions. Once a expired session is found, it is marked as expired and an event is triggered. If wants to terminate the thread must set the again attribute to false.
Overrides:
run in class java.lang.Thread

setAgain

protected void setAgain(boolean newAgain)
Sets the again property (boolean) value.
Parameters:
newAgain - boolean

stopThread

public void stopThread()
Stops the thread.