Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.ssttr.util.processor
Class AbstractProcessor  view AbstractProcessor download AbstractProcessor.java

java.lang.Object
  extended bycom.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.


Nested Class Summary
protected  class AbstractProcessor.ProcessorThread
           
 
Field Summary
protected  int aliveProcessors
           
protected  int maxProcessors
           
protected  int numProcessors
           
protected  java.util.Vector processQueue
           
protected  int runningProcessors
           
 
Constructor Summary
AbstractProcessor(int tasks, int queueSize)
          Creates a new instance of AbstractProcessor that can run tasks simultanious tasks
 
Method Summary
protected  void addAProcessor()
           
 int getQueuedTasks()
          Gets the number of currently queued tasks.
 int getRunningTasks()
          Gets the number of currently running tasks.
 java.lang.Runnable getTask()
           
protected  void killAProcessor()
           
 boolean shutdown()
          Shuts down the Processor without waiting for the individual processors to stop.
 boolean shutdown(int maxWait)
          Shuts down the Processor and waits for all processors to stop.
 void startup()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ssttr.util.processor.Processor
getMaxTasks, getMinTasks, getQueueSize, process, setMaxTasks, setMinTasks, setQueueSize
 

Field Detail

maxProcessors

protected int maxProcessors

numProcessors

protected int numProcessors

aliveProcessors

protected int aliveProcessors

runningProcessors

protected int runningProcessors

processQueue

protected java.util.Vector processQueue
Constructor Detail

AbstractProcessor

public AbstractProcessor(int tasks,
                         int queueSize)
Creates a new instance of AbstractProcessor that can run tasks simultanious tasks

Method Detail

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()