Package com.swiftmq.swiftlet.threadpool
Class ThreadpoolSwiftlet
- java.lang.Object
-
- com.swiftmq.swiftlet.Swiftlet
-
- com.swiftmq.swiftlet.threadpool.ThreadpoolSwiftlet
-
public abstract class ThreadpoolSwiftlet extends Swiftlet
The ThreadpoolSwiftlet manages thread pools for a SwiftMQ router.- Author:
- IIT GmbH, Bremen/Germany, Copyright (c) 2000-2005, All Rights Reserved
-
-
Field Summary
-
Fields inherited from class com.swiftmq.swiftlet.Swiftlet
STATE_ACTIVE, STATE_INACTIVE, STATE_STANDBY
-
-
Constructor Summary
Constructors Constructor Description ThreadpoolSwiftlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
dispatchTask(AsyncTask asyncTask)
Dispatch a task to a pool.abstract ThreadPool
getPool(java.lang.String threadName)
Returns a pool for a given thread name.abstract ThreadPool
getPoolByName(java.lang.String poolName)
Returns a pool by its name.abstract java.lang.String[]
getPoolnames()
Returns all pool names.abstract void
stopPools()
Stops all pools-
Methods inherited from class com.swiftmq.swiftlet.Swiftlet
getName, getStartupTime, getState, isSnapshotAvailable, resume, setStartupTime, shutdown, standby, startup
-
-
-
-
Method Detail
-
getPoolnames
public abstract java.lang.String[] getPoolnames()
Returns all pool names.- Returns:
- array of pool names.
-
getPoolByName
public abstract ThreadPool getPoolByName(java.lang.String poolName)
Returns a pool by its name.- Parameters:
poolName
- the pool name.- Returns:
- a thread pool.
-
getPool
public abstract ThreadPool getPool(java.lang.String threadName)
Returns a pool for a given thread name. Thread names are assigned to pools in the router configuration file.- Parameters:
threadName
- the thread name.- Returns:
- a thread pool.
-
dispatchTask
public abstract void dispatchTask(AsyncTask asyncTask)
Dispatch a task to a pool. This method first determines the pool by the dispatch token of the task and then dispatches the task to the pool. This method is for convinience and should only be used for time-uncritical actions, e.g. if a task is dispatched only once to a pool. Otherwise, the preferred way is to usegetPool()
once and then dispatch the task directly into that pool.- Parameters:
asyncTask
- the task to dispatch.
-
stopPools
public abstract void stopPools()
Stops all pools
-
-