java.lang.Object
com.ssttr.util.processor.AbstractProcessor
- All Implemented Interfaces:
- Processor
- Direct Known Subclasses:
- PoolProcessor, QueueProcessor
- abstract class AbstractProcessor
- extends java.lang.Object
- implements Processor
This class implements the features standard to many other ProcessorS.
|
Constructor Summary |
AbstractProcessor(int tasks,
int queueSize)
Creates a new instance of AbstractProcessor that can run tasks simultanious tasks |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
maxProcessors
protected int maxProcessors
numProcessors
protected int numProcessors
aliveProcessors
protected int aliveProcessors
runningProcessors
protected int runningProcessors
processQueue
protected java.util.Vector processQueue
AbstractProcessor
public AbstractProcessor(int tasks,
int queueSize)
- Creates a new instance of AbstractProcessor that can run
tasks simultanious tasks
startup
public void startup()
- Specified by:
startup in interface Processor
shutdown
public boolean shutdown()
- Description copied from interface:
Processor
- Shuts down the Processor without waiting for the individual processors to stop.
- Specified by:
shutdown in interface Processor
shutdown
public boolean shutdown(int maxWait)
- Description copied from interface:
Processor
- Shuts down the Processor and waits for all processors to stop.
- Specified by:
shutdown in interface Processor
getRunningTasks
public int getRunningTasks()
- Description copied from interface:
Processor
- Gets the number of currently running tasks.
- Specified by:
getRunningTasks in interface Processor
getQueuedTasks
public int getQueuedTasks()
- Description copied from interface:
Processor
- Gets the number of currently queued tasks.
- Specified by:
getQueuedTasks in interface Processor
addAProcessor
protected void addAProcessor()
killAProcessor
protected void killAProcessor()
getTask
public java.lang.Runnable getTask()