Package com.swiftmq.swiftlet.threadpool
Interface ThreadPool
-
- All Known Implementing Classes:
ThreadPoolImpl
public interface ThreadPoolA thread pool.- Author:
- IIT GmbH, Bremen/Germany, Copyright (c) 2000-2002, All Rights Reserved
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Closes the pool.voiddispatchTask(AsyncTask asyncTask)Dispatch a task into the pool.voidfreeze(FreezeCompletionListener listener)Freezes this pool.intgetNumberIdlingThreads()Returns the number of currently idling threads.intgetNumberRunningThreads()Returns the number of currently running threads.java.lang.StringgetPoolName()Returns the pool name.voidstop()Stops the pool.voidunfreeze()Unfreezes this pool.
-
-
-
Method Detail
-
getPoolName
java.lang.String getPoolName()
Returns the pool name.- Returns:
- pool name.
-
getNumberIdlingThreads
int getNumberIdlingThreads()
Returns the number of currently idling threads. Used from management tools only.- Returns:
- number of idling threads.
-
getNumberRunningThreads
int getNumberRunningThreads()
Returns the number of currently running threads. Used from management tools only.- Returns:
- number of running threads.
-
dispatchTask
void dispatchTask(AsyncTask asyncTask)
Dispatch a task into the pool.- Parameters:
asyncTask- the task to dispatch.
-
freeze
void freeze(FreezeCompletionListener listener)
Freezes this pool. That is, the current running tasks are completed but no further tasks will be scheduled until unfreeze() is called. It is possible to dispatch tasks during freeze. However, these will be executed after unfreeze() is called.- Parameters:
listener- will be called when the pool is freezed.
-
unfreeze
void unfreeze()
Unfreezes this pool.
-
stop
void stop()
Stops the pool. Internal use only.
-
close
void close()
Closes the pool. Internal use only.
-
-