uk.ac.vamsas.client.simpleclient
Class ClientSessionFileWatcherElement

java.lang.Object
  extended byuk.ac.vamsas.client.simpleclient.WatcherElement
      extended byuk.ac.vamsas.client.simpleclient.SessionFileWatcherElement
          extended byuk.ac.vamsas.client.simpleclient.ClientSessionFileWatcherElement

public class ClientSessionFileWatcherElement
extends SessionFileWatcherElement


Field Summary
protected  int cycleCountSinceModif
          count of cycles since last modification on the file
 
Fields inherited from class uk.ac.vamsas.client.simpleclient.WatcherElement
handler, handlerCalled, watcher, watchForChange
 
Constructor Summary
ClientSessionFileWatcherElement(SessionFile watcher, WatcherCallBack handler)
           
ClientSessionFileWatcherElement(SessionFile watcher, WatcherCallBack handler, boolean enableWatching)
           
 
Method Summary
 void disableCycleTimeOut()
          Disables the checking on the count of cycles
 boolean doWatch()
          Originally from the uk.ac.vamsas.test.simpleclient.ArchiveClient method
protected  void increaseCycleCount()
          Increases the count of cycles
protected  void resetCycleCount()
          resets count of watch cycles (default value : 0)
 void setTimeoutBeforeLastCycle(int timeoutBeforeLastCycle)
          Enable the time out if the timeout is greater than zero
 
Methods inherited from class uk.ac.vamsas.client.simpleclient.SessionFileWatcherElement
endWatch, getSubject, getWatched, initWatch
 
Methods inherited from class uk.ac.vamsas.client.simpleclient.WatcherElement
callHandler, enableWatch, getHandler, getWatcher, haltWatch, isHandlerCalled, isWatchEnabled, setHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cycleCountSinceModif

protected int cycleCountSinceModif
count of cycles since last modification on the file

Constructor Detail

ClientSessionFileWatcherElement

public ClientSessionFileWatcherElement(SessionFile watcher,
                                       WatcherCallBack handler)
Parameters:
watcher -
handler -

ClientSessionFileWatcherElement

public ClientSessionFileWatcherElement(SessionFile watcher,
                                       WatcherCallBack handler,
                                       boolean enableWatching)
Parameters:
watcher -
handler -
enableWatching -
Method Detail

doWatch

public boolean doWatch()
Description copied from class: WatcherElement
Originally from the uk.ac.vamsas.test.simpleclient.ArchiveClient method

Overrides:
doWatch in class WatcherElement
Returns:
true if the handler was called for a changeEvent
See Also:
* @return true if the handler was called for a changeEvent

resetCycleCount

protected void resetCycleCount()
resets count of watch cycles (default value : 0)


increaseCycleCount

protected void increaseCycleCount()
Increases the count of cycles


setTimeoutBeforeLastCycle

public void setTimeoutBeforeLastCycle(int timeoutBeforeLastCycle)
Enable the time out if the timeout is greater than zero

Parameters:
timeoutBeforeLastCycle - the timeoutBeforeLastCycle to set

disableCycleTimeOut

public void disableCycleTimeOut()
Disables the checking on the count of cycles