Remote System Explorer DataStore
Release 3.0

org.eclipse.dstore.core.model
Class Handler

java.lang.Object
  extended by java.lang.Thread
      extended by org.eclipse.dstore.core.server.SecuredThread
          extended by org.eclipse.dstore.core.model.Handler
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
CommandHandler, Miner, UpdateHandler

public abstract class Handler
extends SecuredThread

The Handler class is the base class for the threaded mechanisms in the DataStore. This is a thread that periodically does some activity. The frequency of handling can be configured.


Field Summary
protected  boolean _keepRunning
           
protected  int _waitIncrement
           
 
Fields inherited from class org.eclipse.dstore.core.server.SecuredThread
_dataStore
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Handler()
          Constructor
 
Method Summary
 void finish()
          Finish handling
 int getWaitTime()
          Returns the time interval to wait between handling
abstract  void handle()
          Implemented to provide the periodic activity to be done in a handler.
 boolean isFinished()
          Indicates whether the handler is finished or not
 void notifyInput()
          Causes all threads waiting for this class request to be filled to wake up.
 void run()
          Runs the handler loop in a thread.
 void setDataStore(DataStore dataStore)
          Sets the associated DataStore
 void setWaitTime(int value)
          Sets the time interval to wait between handling
 void waitForInput()
          Causes the current thread to wait until this class request has been fulfilled.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, 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

_waitIncrement

protected int _waitIncrement

_keepRunning

protected boolean _keepRunning
Constructor Detail

Handler

public Handler()
Constructor

Method Detail

setWaitTime

public void setWaitTime(int value)
Sets the time interval to wait between handling

Parameters:
value - the wait interval

getWaitTime

public int getWaitTime()
Returns the time interval to wait between handling

Returns:
the wait interval

setDataStore

public void setDataStore(DataStore dataStore)
Sets the associated DataStore

Overrides:
setDataStore in class SecuredThread
Parameters:
dataStore -

isFinished

public boolean isFinished()
Indicates whether the handler is finished or not

Returns:
whether the handler is finished or not

finish

public void finish()
Finish handling


handle

public abstract void handle()
Implemented to provide the periodic activity to be done in a handler. This method is called between wait intervals by the handler thread.


run

public void run()
Runs the handler loop in a thread.

Specified by:
run in interface Runnable
Overrides:
run in class SecuredThread

waitForInput

public void waitForInput()
Causes the current thread to wait until this class request has been fulfilled.


notifyInput

public void notifyInput()
Causes all threads waiting for this class request to be filled to wake up.


Remote System Explorer DataStore
Release 3.0

Guidelines for using DataStore APIs.