de.phleisch.app.itsucks.core.impl
Class WorkerThreadImpl

java.lang.Object
  extended by de.phleisch.app.itsucks.core.impl.WorkerThreadImpl
All Implemented Interfaces:
WorkerThread, java.lang.Runnable

public class WorkerThreadImpl
extends java.lang.Object
implements java.lang.Runnable, WorkerThread

This is a single worker to process a job. It is manged by the WorkerPool. The WorkerThread has an interface to add queued commands. So multiple jobs or commands can be given to an workerthread which are processed synchronously.

Author:
olli

Field Summary
 
Fields inherited from interface de.phleisch.app.itsucks.core.WorkerThread
CMD_PROCESS_JOB, CMD_RETURN_TO_POOL, CMD_SHUTDOWN
 
Constructor Summary
WorkerThreadImpl(WorkerPool pWorkerPool, java.lang.String pName)
           
 
Method Summary
 void abort()
           
 void addCommand(int pCmd)
           
 Job getJob()
           
 void join(long pMillis)
           
 void run()
           
 void setJob(Job pJob)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkerThreadImpl

public WorkerThreadImpl(WorkerPool pWorkerPool,
                        java.lang.String pName)
Method Detail

abort

public void abort()
Specified by:
abort in interface WorkerThread

run

public void run()
Specified by:
run in interface java.lang.Runnable

start

public void start()
Specified by:
start in interface WorkerThread

join

public void join(long pMillis)
          throws java.lang.InterruptedException
Specified by:
join in interface WorkerThread
Throws:
java.lang.InterruptedException

addCommand

public void addCommand(int pCmd)
Specified by:
addCommand in interface WorkerThread

getJob

public Job getJob()
Specified by:
getJob in interface WorkerThread

setJob

public void setJob(Job pJob)
Specified by:
setJob in interface WorkerThread


Copyright © 2008. All Rights Reserved.