org.ow2.petals.container.thread
Class ComponentLifeCycleThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.ow2.petals.container.thread.AbstractThread
          extended by org.ow2.petals.container.thread.ComponentLifeCycleThread
All Implemented Interfaces:
java.lang.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 must implements 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
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static java.lang.String INIT
           
static java.lang.String MBEANNAME
           
static java.lang.String SHUTDOWN
           
static java.lang.String START
           
static java.lang.String STOP
           
 
Fields inherited from class org.ow2.petals.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, org.ow2.petals.util.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(java.lang.String action)
          Excute the task.
 javax.jbi.component.Component getComponent()
           
 javax.management.ObjectName getExtensionMBeanName()
           
 
Methods inherited from class org.ow2.petals.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 java.lang.String INIT
See Also:
Constant Field Values

START

public static final java.lang.String START
See Also:
Constant Field Values

STOP

public static final java.lang.String STOP
See Also:
Constant Field Values

SHUTDOWN

public static final java.lang.String SHUTDOWN
See Also:
Constant Field Values

MBEANNAME

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

ComponentLifeCycleThread

public ComponentLifeCycleThread(javax.jbi.component.Component component,
                                long tasktimeout,
                                org.ow2.petals.util.LoggingUtil logger)
Constructor.

Parameters:
component -
tasktimeout -
logger -
Method Detail

doTask

protected boolean doTask(java.lang.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 javax.management.ObjectName getExtensionMBeanName()


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.