|
|||||||||
| Home >> All >> com >> ssttr >> util >> [ processor overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.ssttr.util.processor
Class PoolProcessor

java.lang.Objectcom.ssttr.util.processor.AbstractProcessor
com.ssttr.util.processor.PoolProcessor
- All Implemented Interfaces:
- Processor
- public class PoolProcessor
- extends AbstractProcessor
- implements Processor
- extends AbstractProcessor
A PoolProcessor has a fixed number of task processors available. If the pool is full, then no more tasks can be processed untill another task is finished and leaves.
| 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 | |
PoolProcessor()
Creates a new instance of PoolProcessor with a poolSize of 10 |
|
PoolProcessor(int poolSize)
Creates a new instance of PoolProcessor |
|
| Method Summary | |
protected void |
addAProcessor()
|
int |
getMaxTasks()
Gets the maximum number of tasks this processor will run at a time. |
int |
getMinTasks()
Not used in this Processor |
int |
getQueuedTasks()
Gets the number of currently queued tasks. |
int |
getQueueSize()
Not used in this Processor |
int |
getRunningTasks()
Gets the number of currently running tasks. |
java.lang.Runnable |
getTask()
|
protected void |
killAProcessor()
|
boolean |
process(java.lang.Runnable task)
Processes the given task. |
void |
setMaxTasks(int maxTasks)
Sets the maximum number of tasks this processor will run at a time. |
void |
setMinTasks(int minTasks)
Not used in this Processor |
void |
setQueueSize(int queueSize)
Not used in this Processor |
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 |
getQueuedTasks, getRunningTasks, shutdown, shutdown, startup |
| 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 |
PoolProcessor
public PoolProcessor()
- Creates a new instance of PoolProcessor with a
poolSizeof 10
PoolProcessor
public PoolProcessor(int poolSize)
- Creates a new instance of PoolProcessor
| Method Detail |
process
public boolean process(java.lang.Runnable task)
setMaxTasks
public void setMaxTasks(int maxTasks)
- Description copied from interface:
Processor - Sets the maximum number of tasks this processor will run at a time.
- Specified by:
setMaxTasksin interfaceProcessor
getMaxTasks
public int getMaxTasks()
- Description copied from interface:
Processor - Gets the maximum number of tasks this processor will run at a time.
- Specified by:
getMaxTasksin interfaceProcessor
setMinTasks
public void setMinTasks(int minTasks)
- Not used in this Processor
- Specified by:
setMinTasksin interfaceProcessor
getMinTasks
public int getMinTasks()
- Not used in this Processor
- Specified by:
getMinTasksin interfaceProcessor
setQueueSize
public void setQueueSize(int queueSize)
- Not used in this Processor
- Specified by:
setQueueSizein interfaceProcessor
getQueueSize
public int getQueueSize()
- Not used in this Processor
- Specified by:
getQueueSizein interfaceProcessor
startup
public void startup()
shutdown
public boolean shutdown()
- Description copied from interface:
Processor - Shuts down the Processor without waiting for the individual processors to stop.
shutdown
public boolean shutdown(int maxWait)
- Description copied from interface:
Processor - Shuts down the Processor and waits for all processors to stop.
getRunningTasks
public int getRunningTasks()
- Description copied from interface:
Processor - Gets the number of currently running tasks.
- Specified by:
getRunningTasksin interfaceProcessor
getQueuedTasks
public int getQueuedTasks()
- Description copied from interface:
Processor - Gets the number of currently queued tasks.
- Specified by:
getQueuedTasksin interfaceProcessor
addAProcessor
protected void addAProcessor()
killAProcessor
protected void killAProcessor()
getTask
public java.lang.Runnable getTask()
|
|||||||||
| Home >> All >> com >> ssttr >> util >> [ processor overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC