|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simpleframework.util.thread.PoolExecutor
public class PoolExecutor
The PoolExecutor
object is used to execute tasks in
a thread pool. This creates a thread pool with an unbounded list
of outstanding tasks, which ensures that any system requesting
a task to be executed will not block when handing it over.
Constructor Summary | |
---|---|
PoolExecutor(java.lang.Class<? extends java.lang.Runnable> type)
Constructor for the PoolExecutor object. |
|
PoolExecutor(java.lang.Class<? extends java.lang.Runnable> type,
int size)
Constructor for the PoolExecutor object. |
|
PoolExecutor(java.lang.Class<? extends java.lang.Runnable> type,
int rest,
int active)
Constructor for the PoolExecutor object. |
Method Summary | |
---|---|
void |
execute(java.lang.Runnable task)
The execute method is used to queue the task for
execution. |
void |
stop()
This is used to stop the executor by interrupting all running tasks and shutting down the threads within the pool. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PoolExecutor(java.lang.Class<? extends java.lang.Runnable> type)
PoolExecutor
object. This is
used to create a pool of threads that can be used to execute
arbitrary Runnable
tasks. If the threads are
busy this will simply enqueue the tasks and return.
type
- this is the type of runnable that this acceptspublic PoolExecutor(java.lang.Class<? extends java.lang.Runnable> type, int size)
PoolExecutor
object. This is
used to create a pool of threads that can be used to execute
arbitrary Runnable
tasks. If the threads are
busy this will simply enqueue the tasks and return.
type
- this is the type of runnable that this acceptssize
- this is the number of threads to use in the poolpublic PoolExecutor(java.lang.Class<? extends java.lang.Runnable> type, int rest, int active)
PoolExecutor
object. This is
used to create a pool of threads that can be used to execute
arbitrary Runnable
tasks. If the threads are
busy this will simply enqueue the tasks and return.
type
- this is the type of runnable that this acceptsrest
- this is the number of threads to use in the poolactive
- this is the maximum size the pool can grow toMethod Detail |
---|
public void execute(java.lang.Runnable task)
execute
method is used to queue the task for
execution. If all threads are busy the provided task is queued
and waits until all current and outstanding tasks are finished.
execute
in interface java.util.concurrent.Executor
task
- this is the task to be queued for executionpublic void stop()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |