org.ow2.petals.microkernel.api.container.thread
Class ComponentLifeCycleThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.ow2.petals.microkernel.api.container.thread.AbstractThread
          extended by org.ow2.petals.microkernel.api.container.thread.ComponentLifeCycleThread
All Implemented Interfaces:
Runnable

public class ComponentLifeCycleThread
extends AbstractThread

The component life cycle thread.

Each component life cycle have its own thread to process operation that requires own ClassLoader.

NOTE: This should implement the javax.jbi.component.ComponentLifeCycle interface but due to the use of Thread and the start/stop methods it is impossible to do this. LET'S SEE IF FUTURE JAVA VERSION ALLOWS TO DO THINGS LIKE THAT.

Author:
Christophe Hamerling - EBM WebSourcing

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static String INIT
           
static String MBEANNAME
           
static String SHUTDOWN
           
static String START
           
static String STOP
           
 
Fields inherited from class org.ow2.petals.microkernel.api.container.thread.AbstractThread
jbiException, logger, requestQueue, responseQueue, SHUTDOWNTHREAD, timeout
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ComponentLifeCycleThread(javax.jbi.component.Component component, long tasktimeout, LoggingUtil logger)
          Constructor.
 
Method Summary
 void doInit(javax.jbi.component.ComponentContext context)
           
 void doShutdown()
          Shutdown life cycle step
 void doStart()
          Start life cycle step
 void doStop()
          Stop life cycle step
protected  boolean doTask(String action)
          Excute the task.
 javax.jbi.component.Component getComponent()
           
 ObjectName getExtensionMBeanName()
           
 
Methods inherited from class org.ow2.petals.microkernel.api.container.thread.AbstractThread
execute, run, shutdownThread
 
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

INIT

public static final String INIT
See Also:
Constant Field Values

START

public static final String START
See Also:
Constant Field Values

STOP

public static final String STOP
See Also:
Constant Field Values

SHUTDOWN

public static final String SHUTDOWN
See Also:
Constant Field Values

MBEANNAME

public static final String MBEANNAME
See Also:
Constant Field Values
Constructor Detail

ComponentLifeCycleThread

public ComponentLifeCycleThread(javax.jbi.component.Component component,
                                long tasktimeout,
                                LoggingUtil logger)
Constructor.

Parameters:
component -
tasktimeout -
logger -
Method Detail

doTask

protected boolean doTask(String action)
Excute the task.

Specified by:
doTask in class AbstractThread
Parameters:
action -
Returns:
true if the thread needs to continue, false if shutdown is required

getComponent

public javax.jbi.component.Component getComponent()
Returns:
the component

doStart

public void doStart()
             throws javax.jbi.JBIException
Start life cycle step

Throws:
javax.jbi.JBIException

doStop

public void doStop()
            throws javax.jbi.JBIException
Stop life cycle step

Throws:
javax.jbi.JBIException

doShutdown

public void doShutdown()
                throws javax.jbi.JBIException
Shutdown life cycle step

Throws:
javax.jbi.JBIException

doInit

public void doInit(javax.jbi.component.ComponentContext context)
            throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

getExtensionMBeanName

public ObjectName getExtensionMBeanName()


Copyright © 2005-2015 Linagora. All Rights Reserved.