org.mule.component
Class DefaultLifecycleAdapter

java.lang.Object
  extended by org.mule.component.DefaultLifecycleAdapter
All Implemented Interfaces:
LifecycleAdapter, Interceptor, Disposable, Initialisable, Lifecycle, Startable, Stoppable

public class DefaultLifecycleAdapter
extends Object
implements LifecycleAdapter

DefaultLifecycleAdapter provides lifecycle methods for all Mule managed components. It's possible to plugin custom lifecycle adapters, this can provide additional lifecycle methods triggered by an external source.


Field Summary
protected  JavaComponent component
           
protected  Object componentObject
           
protected static Log logger
          logger used by this class
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
DefaultLifecycleAdapter(Object componentObject, JavaComponent component)
           
DefaultLifecycleAdapter(Object componentObject, JavaComponent component, EntryPointResolverSet entryPointResolver)
           
 
Method Summary
protected  void configureNestedRouter()
           
 void dispose()
          Propagates dispose() life-cycle to component object implementations if they implement the mule Disposable interface.
 void initialise()
          Propagates initialise() life-cycle to component object implementations if they implement the mule Initialisable interface.
 MuleMessage intercept(Invocation invocation)
          Invoked when the component should be called.
 boolean isDisposed()
           
 boolean isStarted()
           
 void start()
          Propagates start() life-cycle to component object implementations if they implement the mule Startable interface.
 void stop()
          Propagates stop() life-cycle to component object implementations if they implement the mule Stoppable interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final Log logger
logger used by this class


componentObject

protected Object componentObject

component

protected JavaComponent component
Constructor Detail

DefaultLifecycleAdapter

public DefaultLifecycleAdapter(Object componentObject,
                               JavaComponent component)
                        throws MuleException
Throws:
MuleException

DefaultLifecycleAdapter

public DefaultLifecycleAdapter(Object componentObject,
                               JavaComponent component,
                               EntryPointResolverSet entryPointResolver)
                        throws MuleException
Throws:
MuleException
Method Detail

start

public void start()
           throws MuleException
Propagates start() life-cycle to component object implementations if they implement the mule Startable interface. NOT: It is up to component implementations to ensure their implementation of start() is thread-safe.

Specified by:
start in interface Startable
Throws:
MuleException

stop

public void stop()
          throws MuleException
Propagates stop() life-cycle to component object implementations if they implement the mule Stoppable interface. NOT: It is up to component implementations to ensure their implementation of stop() is thread-safe.

Specified by:
stop in interface Stoppable
Throws:
MuleException

dispose

public void dispose()
Propagates dispose() life-cycle to component object implementations if they implement the mule Disposable interface. NOT: It is up to component implementations to ensure their implementation of dispose() is thread-safe.

Specified by:
dispose in interface Disposable

isStarted

public boolean isStarted()
Specified by:
isStarted in interface LifecycleAdapter
Returns:
true if the service has been started

isDisposed

public boolean isDisposed()
Specified by:
isDisposed in interface LifecycleAdapter
Returns:
whether the service managed by this lifecycle has been disposed

intercept

public MuleMessage intercept(Invocation invocation)
                      throws MuleException
Description copied from interface: Interceptor
Invoked when the component should be called. The implementation can call Invocation.execute() to call the component.

Specified by:
intercept in interface Interceptor
Parameters:
invocation - the invocation containing info about the current message and service
Returns:
A result message that may have been altered by this invocation
Throws:
MuleException - if the invocation fails

initialise

public void initialise()
                throws InitialisationException
Propagates initialise() life-cycle to component object implementations if they implement the mule Initialisable interface.

NOTE: It is up to component implementations to ensure their implementation of initialise() is thread-safe.

Specified by:
initialise in interface Initialisable
Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from

configureNestedRouter

protected void configureNestedRouter()
                              throws MuleException
Throws:
MuleException


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.