isc.sensor
Class SessionTimer

java.lang.Object
  extended by java.lang.Thread
      extended by isc.sensor.SessionTimer
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
TCPSessionTimer, UDPSessionTimer

public class SessionTimer
extends java.lang.Thread

The Session Timers (TCP/UDP) runs in a background thread a periodically check each session for it's close state

Author:
John Casey
Project: DNA_sensor - Aug 12, 2005

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  boolean finish
          Flag to determine when server is exiting
protected static org.apache.log4j.Logger log
          log4j
protected  long packetTime
          Current packet clock time
protected  AppProperties props
          Application properties
protected  long sleepTime
          sleep loop time
protected  long timeOut
          Time period to close sessions that haven't seen any more packets
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SessionTimer()
           
 
Method Summary
 boolean finished()
          Check if the process is in exiting state
 long getPacketTime()
          Get the current packet clock time
 void notifyProc()
          Notify the sleeping thread of an event
 void setFinish()
          Signal to the end of process and finish all work
 void setPacketTime(long ptime)
          Set the packet time clock to current packet
protected  void waitProc()
          Wait on mutex and timeout
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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

sleepTime

protected long sleepTime
sleep loop time


timeOut

protected long timeOut
Time period to close sessions that haven't seen any more packets


finish

protected volatile boolean finish
Flag to determine when server is exiting


packetTime

protected volatile long packetTime
Current packet clock time


props

protected AppProperties props
Application properties


log

protected static org.apache.log4j.Logger log
log4j

Constructor Detail

SessionTimer

public SessionTimer()
Method Detail

setPacketTime

public void setPacketTime(long ptime)
Set the packet time clock to current packet

Parameters:
ptime - The packet time in milliseconds

getPacketTime

public long getPacketTime()
Get the current packet clock time

Returns:
The current packet clock time in milliseconds

waitProc

protected void waitProc()
Wait on mutex and timeout


setFinish

public void setFinish()
Signal to the end of process and finish all work


finished

public boolean finished()
Check if the process is in exiting state

Returns:
True if the process is exiting

notifyProc

public void notifyProc()
Notify the sleeping thread of an event