Package com.swiftmq.client.thread
Class IVMTaskScheduler
java.lang.Object
com.swiftmq.client.thread.IVMTaskScheduler
- All Implemented Interfaces:
ThreadPool
-
Constructor Summary
Constructors -
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.toString()
void
unfreeze()
Unfreezes this pool.
-
Constructor Details
-
IVMTaskScheduler
public IVMTaskScheduler()
-
-
Method Details
-
close
public void close()Closes the pool. Internal use only.- Specified by:
close
in interfaceThreadPool
-
getPoolName
Returns the pool name.- Specified by:
getPoolName
in interfaceThreadPool
- Returns:
- pool name.
-
getNumberIdlingThreads
public int getNumberIdlingThreads()Returns the number of currently idling threads. Used from management tools only.- Specified by:
getNumberIdlingThreads
in interfaceThreadPool
- Returns:
- number of idling threads.
-
getNumberRunningThreads
public int getNumberRunningThreads()Returns the number of currently running threads. Used from management tools only.- Specified by:
getNumberRunningThreads
in interfaceThreadPool
- Returns:
- number of running threads.
-
dispatchTask
Dispatch a task into the pool.- Specified by:
dispatchTask
in interfaceThreadPool
- 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.- Specified by:
freeze
in interfaceThreadPool
- Parameters:
listener
- will be called when the pool is freezed.
-
unfreeze
public void unfreeze()Unfreezes this pool.- Specified by:
unfreeze
in interfaceThreadPool
-
stop
public void stop()Stops the pool. Internal use only.- Specified by:
stop
in interfaceThreadPool
-
toString
-