org.jboss.web.tomcat.tc5.session
Class IntervalSnapshotManager

java.lang.Object
  extended byorg.jboss.web.tomcat.tc5.session.SnapshotManager (src) 
      extended byorg.jboss.web.tomcat.tc5.session.IntervalSnapshotManager
All Implemented Interfaces:
java.lang.Runnable

public class IntervalSnapshotManager
extends SnapshotManager (src)
implements java.lang.Runnable

A snapshot manager that collects all modified sessions over a given period of time and distributes them en bloc.


Field Summary
protected  int interval
           
protected  java.util.HashMap sessions
           
protected  java.lang.Thread thread
           
protected  boolean threadDone
           
 
Fields inherited from class org.jboss.web.tomcat.tc5.session.SnapshotManager (src)
contextPath, manager
 
Constructor Summary
IntervalSnapshotManager(AbstractJBossManager (src)  manager, java.lang.String path)
           
IntervalSnapshotManager(AbstractJBossManager (src)  manager, java.lang.String path, int interval)
           
 
Method Summary
protected  void processSessions()
          Distribute all modified sessions
 void run()
          Thread-loop
 void snapshot(java.lang.String id)
          Store the modified session in a hashmap for the distributor thread
 void start()
          Start the snapshot manager
protected  void startThread()
          Start the distributor thread
 void stop()
          Stop the snapshot manager
protected  void stopThread()
          Stop the distributor thread
protected  void threadSleep()
          Little Thread - sleep awhile...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

interval

protected int interval

sessions

protected java.util.HashMap sessions

thread

protected java.lang.Thread thread

threadDone

protected boolean threadDone
Constructor Detail

IntervalSnapshotManager

public IntervalSnapshotManager(AbstractJBossManager (src)  manager,
                               java.lang.String path)

IntervalSnapshotManager

public IntervalSnapshotManager(AbstractJBossManager (src)  manager,
                               java.lang.String path,
                               int interval)
Method Detail

snapshot

public void snapshot(java.lang.String id)
Store the modified session in a hashmap for the distributor thread

Specified by:
snapshot in class SnapshotManager (src)

processSessions

protected void processSessions()
Distribute all modified sessions


start

public void start()
Start the snapshot manager

Specified by:
start in class SnapshotManager (src)

stop

public void stop()
Stop the snapshot manager

Specified by:
stop in class SnapshotManager (src)

startThread

protected void startThread()
Start the distributor thread


stopThread

protected void stopThread()
Stop the distributor thread


threadSleep

protected void threadSleep()
Little Thread - sleep awhile...


run

public void run()
Thread-loop

Specified by:
run in interface java.lang.Runnable