Package com.swiftmq.swiftlet.threadpool
Interface ThreadPool
- All Known Implementing Classes:
ThreadPoolImpl
public interface ThreadPool
A thread pool.
- Author:
- IIT GmbH, Bremen/Germany, Copyright (c) 2000-2002, All Rights Reserved
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the pool.void
dispatchTask
(AsyncTask asyncTask) Dispatch a task into the pool.void
freeze
(FreezeCompletionListener listener) Freezes this pool.int
Returns the number of currently idling threads.int
Returns the number of currently running threads.Returns the pool name.void
stop()
Stops the pool.void
unfreeze()
Unfreezes this pool.
-
Method Details
-
getPoolName
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
Dispatch a task into the pool.- Parameters:
asyncTask
- the task to dispatch.
-
freeze
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.
-