public class PoolMgr extends FrameworkBase
PoolMgr implements a Thread Pool. Thread Pool
simply keeps a bunch of suspended threads around to do some work.
active, initMessage, inProcess, jvmService, running, serviceData, totalErrors, totalMessages, totalProcessedCATEGROY_ADAPTER, CATEGROY_APP, CATEGROY_DB_CON, CATEGROY_DB_POOL, CATEGROY_ENGINE, CATEGROY_MODULE, CATEGROY_POOL_MGR, CATEGROY_QUEUE, CATEGROY_THREAD_MGR, CATEGROY_WORKER, COMMAND_DEREGISTER_KEY, COMMAND_PAUSE, COMMAND_REGISTER_KEY, COMMAND_RESTART, COMMAND_SHUTDOWN, COMMAND_START, COMMAND_STOP, FLAG_FALSE, FLAG_TRUE, PARAM_JVM_STR, PARAM_JVMID_STR, PARAM_SERVERNAME_STR, PARAM_SERVICEACTIVE_STR, PARAM_SERVICECATAGORY_STR, PARAM_SERVICENAME_STR, PARAM_SERVICERUNNING_STR, TYPE_CLUSTER, TYPE_DISPLAY_STR, TYPE_EVENT, TYPE_JVM, TYPE_JVM_STR, TYPE_MAX, TYPE_SERVER, TYPE_SERVICE| Constructor and Description |
|---|
PoolMgr()
Constructor - creates a new thread Pool
|
| Modifier and Type | Method and Description |
|---|---|
int |
getDefError() |
int |
getMaxTotalThreads()
This method
getMaxTotalThreads will return the total number
of max threads reached. |
String |
getName()
This method will return the pool manager name.
|
MessageIntf |
getPoolServiceData(String aName)
This method will return a new ServiceData based on the suppplied serice
name.
|
List<WorkerThread> |
getThreadList() |
int |
getThreadPriority()
This method will return the thread priority
|
Collection<WorkerThread> |
getThreadsList() |
int |
getTotalRunning()
This method will return the internal memory queue name.
|
List<Object> |
getWorkersServiceData() |
void |
init(ThreadMgr aThreadMgr,
int aMin,
int aMax,
int aPriority,
Class<ServicesIntf> aServicesClass)
Initializes a new Pool instance
|
void |
performWork(MessageIntf aMsg)
Request the Pool to perform some work.
|
void |
reaper()
This method is called by a cleanup thread to removed unused and inactive
threads.
|
void |
reaper(boolean aForce) |
void |
shutdown()
This method is called to gracefully shutdown, stop the threads and
free resources.
|
addInProcess, addTotalErrorNumber, addTotalMsgNumber, addTotalProcessed, deRegister, deRegister, doEventMessage, doMessage, getInProcess, getJvmId, getJvmService, getService, getServiceData, getServiceName, getStats, getTotalErrorNumber, getTotalMsgNumber, getTotalProcessed, initMessage, isActive, isRunning, register, register, resetTotals, setActive, setRunning, setServiceData, subtractInProcesspublic void init(ThreadMgr aThreadMgr, int aMin, int aMax, int aPriority, Class<ServicesIntf> aServicesClass) throws Exception
aThreadMgr - an ThreadMgr Manages all Thread PoolsaMin - an int Min ThreadsaMax - an int Max ThreadsaPriority - an int Thread PriorityaServicesClass - a Class Java Worker ClassException - expublic int getThreadPriority()
public String getName()
getName in interface FrameworkIntfgetName in class FrameworkBasepublic int getTotalRunning()
public void performWork(MessageIntf aMsg) throws InstantiationException
aMsg - Data to give to the WorkerInstantiationException - Thrown if additional worker can't be createdpublic int getMaxTotalThreads()
getMaxTotalThreads will return the total number
of max threads reached.
int Total max number of threadspublic void reaper()
public void reaper(boolean aForce)
public List<WorkerThread> getThreadList()
public MessageIntf getPoolServiceData(String aName)
aName - string Service Namepublic void shutdown()
public Collection<WorkerThread> getThreadsList()
public int getDefError()
getDefError in class FrameworkBaseCopyright © 2020. All rights reserved.