uk.ac.vamsas.client.simpleclient
Class EventGeneratorThread

java.lang.Object
  extended byuk.ac.vamsas.client.simpleclient.EventGeneratorThread

public class EventGeneratorThread
extends java.lang.Object

monitors watcher objects and generates events.


Field Summary
protected  SessionFileWatcherElement clientfile
          Watcher element for list of all the clientHandles for the session
protected  SessionFileWatcherElement storeFile
          written to by client when its app calls storeDocument.
protected  VamsasFileWatcherElement vamsasfile
          the session's vamsasDocument
protected  VamsasFileWatcherThread watchThread
          thread watching all the session's file objects
 
Method Summary
protected  int countHandlersFor(java.lang.String event)
          count handlers for a particular vamsas event
 void disableDocumentWatch()
           
protected  boolean documentChanged(Lock doclock)
           
 void enableDocumentWatch()
           
 void interruptWatching()
           
 boolean isDocumentWatchEnabled()
           
 boolean isWatcherAlive()
           
 void startWatching()
          called to start the session watching thread which generates events
 void stopWatching()
           
protected  boolean storeDocRequest(Lock lock)
           
protected  void wait(int u)
           
protected  Lock want_to_store()
          client App requests offline storage of vamsas data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

watchThread

protected VamsasFileWatcherThread watchThread
thread watching all the session's file objects


clientfile

protected SessionFileWatcherElement clientfile
Watcher element for list of all the clientHandles for the session


vamsasfile

protected VamsasFileWatcherElement vamsasfile
the session's vamsasDocument


storeFile

protected SessionFileWatcherElement storeFile
written to by client when its app calls storeDocument.

Method Detail

storeDocRequest

protected boolean storeDocRequest(Lock lock)

documentChanged

protected boolean documentChanged(Lock doclock)

wait

protected void wait(int u)

want_to_store

protected Lock want_to_store()
client App requests offline storage of vamsas data. Call blocks whilst other apps do any appData finalizing and then returns (after locking the vamsasDocument in the session) Note - the calling app may also receive events through the EventGeneratorThread for document updates.

Returns:
Lock for session.vamArchive

countHandlersFor

protected int countHandlersFor(java.lang.String event)
count handlers for a particular vamsas event

Parameters:
event - string enumeration from uk.ac.vamsas.client.Events
Returns:
-1 for an invalid event, otherwise the number of handlers

disableDocumentWatch

public void disableDocumentWatch()

isDocumentWatchEnabled

public boolean isDocumentWatchEnabled()

enableDocumentWatch

public void enableDocumentWatch()

isWatcherAlive

public boolean isWatcherAlive()

interruptWatching

public void interruptWatching()

startWatching

public void startWatching()
called to start the session watching thread which generates events


stopWatching

public void stopWatching()