Package jadex.commons.concurrent
Interface IThreadPool
- 
- All Known Subinterfaces:
- IDaemonThreadPoolService,- IThreadPoolService
 - All Known Implementing Classes:
- AdvancedThreadPoolService,- JavaThreadPool,- ThreadPool,- ThreadPoolService
 
 public interface IThreadPoolCommon interface for different thread pool implementations.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddFinishListener(IChangeListener<java.lang.Void> listener)Add a finished listener.voiddispose()Shutdown the thread pool.voidexecute(java.lang.Runnable task)Execute a task in its own thread.voidexecuteForever(java.lang.Runnable task)Execute a task in its own thread.booleanisRunning()Test if the thread pool is running.
 
- 
- 
- 
Method Detail- 
executevoid execute(java.lang.Runnable task) Execute a task in its own thread.- Parameters:
- task- The task to execute.
 
 - 
executeForevervoid executeForever(java.lang.Runnable task) Execute a task in its own thread. The pool expects the thread executing the task to never return. Preferably use this method if you want to permanently retrieve a thread e.g. for repeated blocking operations. Consider requesting the daemon version.- Parameters:
- task- The task to execute.
 
 - 
disposevoid dispose() Shutdown the thread pool.
 - 
isRunningboolean isRunning() Test if the thread pool is running.
 - 
addFinishListenervoid addFinishListener(IChangeListener<java.lang.Void> listener) Add a finished listener.
 
- 
 
-