|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.util.TaskService
public final class TaskService
Reuse threads instead of making new ones over and over.
Method Summary | ||
---|---|---|
void |
setExecutorService(java.util.concurrent.ExecutorService eService)
Allows more control over how threads can be allocated. |
|
void |
setMaxNumThreads(int maxNumThreads)
If called, will replace the default unbounded executor using a cached thread pool with a fixed thread pool executor, so the maxNumThreads are allocated. |
|
static TaskService |
singleton()
|
|
|
spawn(java.util.concurrent.Callable<T> task)
|
|
void |
spawn(java.lang.Runnable task)
Run a task in a thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static TaskService singleton()
public void spawn(java.lang.Runnable task)
task
- the runnablepublic <T> java.util.concurrent.Future<T> spawn(java.util.concurrent.Callable<T> task)
public void setExecutorService(java.util.concurrent.ExecutorService eService)
eService
- ExecutorService that allocates and schedules thread
spawning for layers.public void setMaxNumThreads(int maxNumThreads)
maxNumThreads
- number of threads to allocate for the thread pool
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |