pt.digitalis.iss
Class Worker

java.lang.Object
  extended by java.lang.Thread
      extended by pt.digitalis.iss.Worker
All Implemented Interfaces:
Runnable

public final class Worker
extends Thread

This class implements a Worker: a thread entity that executes requests. When the worker is created and started it fetches a request from it's associated ISS and serves and returns the request. The worker will repeat this fetch-serve-return loop while there are requests on the ISS's waiting queue. When the queue is empty the Worker notifies the ISS that it's duty is over and ceases to exist. The class is final so no one can change the way the Worker works (no pun intended). If some changes were made to the Worker by subclassing the ISS might not function properly. The Worker is a private part of the ISS and thus not meant to be extended.

Author:
Rodrigo Gonçalves rgoncalves@digitalis.pt

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Worker(ISSRequestManagement theManager)
          Constructor.
 
Method Summary
 void run()
          Overriding Thread#run()...
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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
 

Constructor Detail

Worker

public Worker(ISSRequestManagement theManager)
Constructor. Constructs a new Worker and initialize ISS attribute.

Parameters:
theManager - the manager that called this Worker
Method Detail

run

public void run()
Overriding Thread#run()...

Specified by:
run in interface Runnable
Overrides:
run in class Thread
See Also:
Runnable.run()


Copyright © 2010 Digitalis Informática Lda. All Rights Reserved.