org.syrup.helpers
Class ExecutionMonitor

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.syrup.helpers.ExecutionMonitor
All Implemented Interfaces:
java.lang.Runnable

public class ExecutionMonitor
extends java.lang.Thread

Implements a simple request/response server during the execution of a Task.

Author:
Robbert van Dalen

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
static java.lang.String checkin(java.lang.String key)
          Register a Task that will be executed by the current Worker.
static void checkout(java.lang.String key)
          Un-registers a Task that has been executed by a Worker (or failed).
static java.util.Hashtable monitors()
           
 void run()
          Main processing method for the ExecutionMonitor object
 java.lang.String url()
          Returns the URL based on the current Worker's inet address.
 
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
 

Method Detail

checkin

public static java.lang.String checkin(java.lang.String key)
                                throws java.lang.Exception
Register a Task that will be executed by the current Worker. The Task is registered against the current Thread. The same Thread should unregister the same Task.

Parameters:
key - The Task's key to be registered by a Worker (Thread).
Returns:
The URL address of the requesting Worker.
Throws:
java.lang.Exception

checkout

public static void checkout(java.lang.String key)
                     throws java.lang.Exception
Un-registers a Task that has been executed by a Worker (or failed).

Parameters:
key - The Task's key to be unregistered.
Throws:
java.lang.Exception

run

public void run()
Main processing method for the ExecutionMonitor object


url

public java.lang.String url()
Returns the URL based on the current Worker's inet address.


monitors

public static java.util.Hashtable monitors()