|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.knowgate.scheduler.WorkerThreadPool
public class WorkerThreadPool
WorkerThread Pool
| Constructor Summary | |
|---|---|
WorkerThreadPool(AtomConsumer oAtomConsumer,
java.util.Properties oEnvironmentProps)
Create WorkerThreadPool thread Pool size is readed from maxschedulerthreads property of oEnvironmentProps, the default value is 1. |
|
| Method Summary | |
|---|---|
java.util.Properties |
getProperties()
Get Environment properties collection from hipergate.cnf |
java.lang.String |
getProperty(java.lang.String sKey)
Get Environment property |
long |
getRunningTimeMS()
|
void |
haltAll()
Halt all pooled threads commiting any pending operations before stoping If a thread is dead-locked by any reason halting it will not cause any effect. |
void |
launchAll()
Launch all WorkerThreads and start consuming atoms from queue. |
int |
livethreads()
Count of currently active WorkerThreads |
void |
registerCallback(WorkerThreadCallback oNewCallback)
Register a thread callback object for each thread in this pool |
Atom[] |
runningAtoms()
Get array of atoms currently running at live WorkerThreads |
java.lang.String[] |
runningJobs()
Get array with GUIDs of Jobs currently run by live WorkerThreads |
int |
size()
Get Pool Size |
void |
stopAll()
Deprecated. Use stopAll(JDCConnection) instead |
void |
stopAll(JDCConnection oConn)
Call stop() on every thread of the pool which is alive All running atoms are set to STATUS_INTERRUPTED |
WorkerThread[] |
threads()
|
void |
unregisterCallback(java.lang.String sCallbackName)
Unregister a thread callback object for each thread in this pool |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WorkerThreadPool(AtomConsumer oAtomConsumer,
java.util.Properties oEnvironmentProps)
Create WorkerThreadPool
thread Pool size is readed from maxschedulerthreads property of oEnvironmentProps, the default value is 1. Each thread is given the name WorkerThread_n
oAtomConsumer - Atom Consumer Object to be usedoEnvironmentProps - Environment Properties collection
(usually readed from hipergate.cnf)| Method Detail |
|---|
public int size()
public java.util.Properties getProperties()
public java.lang.String getProperty(java.lang.String sKey)
public long getRunningTimeMS()
public void launchAll()
throws java.lang.IllegalThreadStateException
java.lang.IllegalThreadStateExceptionpublic int livethreads()
public WorkerThread[] threads()
public Atom[] runningAtoms()
public java.lang.String[] runningJobs()
public void registerCallback(WorkerThreadCallback oNewCallback)
throws java.lang.IllegalArgumentException
oNewCallback - WorkerThreadCallback subclass instance
java.lang.IllegalArgumentException - If a callback with same name has oNewCallback was already registeredpublic void unregisterCallback(java.lang.String sCallbackName)
sCallbackName - Name of callback to be unregisteredpublic void haltAll()
Halt all pooled threads commiting any pending operations before stoping
If a thread is dead-locked by any reason halting it will not cause any effect.
public void stopAll()
Call stop() on every thread of the pool which is alive
This method should only be used when threads cannot be stopped by calling haltAll()
public void stopAll(JDCConnection oConn)
throws java.sql.SQLException
Call stop() on every thread of the pool which is alive
All running atoms are set to STATUS_INTERRUPTED
java.sql.SQLException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||