|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.ow2.petals.microkernel.api.container.thread.AbstractThread
public abstract class AbstractThread
This class is the parent class for managing tasks to perform on Components, Bootstrap and ServiceAssemblies. Tasks on those objects are performed in a dedicated thread, preventing the main thread to be blocked. When a timeout exceeds on an action, the task is considered as blocked, and an exception is thrown
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected javax.jbi.JBIException |
jbiException
Exception thrown when a task failed in its own thread. |
protected LoggingUtil |
logger
|
protected BlockingQueue<String> |
requestQueue
The blocking working queue is equal to a FIFO. |
protected BlockingQueue<String> |
responseQueue
The response queue used to wait for the task to complete. |
static String |
SHUTDOWNTHREAD
Shutdown thread action |
protected long |
timeout
Time before an action is considered as blocked Exception is thrown when this time exceed |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
AbstractThread(long taskTimeout,
LoggingUtil logger)
Creates a new instance of AbstractThread |
Method Summary | |
---|---|
protected abstract boolean |
doTask(String action)
Execute the task in the dedicated thread. |
protected void |
execute(String action)
Execute the action. |
void |
run()
|
void |
shutdownThread()
Shutdown the current thread |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected javax.jbi.JBIException jbiException
protected BlockingQueue<String> requestQueue
protected BlockingQueue<String> responseQueue
public static final String SHUTDOWNTHREAD
protected final LoggingUtil logger
protected long timeout
Constructor Detail |
---|
public AbstractThread(long taskTimeout, LoggingUtil logger)
Method Detail |
---|
public void run()
run
in interface Runnable
run
in class Thread
protected abstract boolean doTask(String action)
protected void execute(String action) throws javax.jbi.JBIException
action
-
javax.jbi.JBIException
public void shutdownThread() throws javax.jbi.JBIException
javax.jbi.JBIException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |