org.mule.impl
Class DefaultLifecycleAdapter

java.lang.Object
  extended by org.mule.impl.DefaultLifecycleAdapter
All Implemented Interfaces:
Disposable, Initialisable, Lifecycle, Startable, Stoppable, UMOLifecycleAdapter, UMOInterceptor
Direct Known Subclasses:
TestDefaultLifecycleAdapter

public class DefaultLifecycleAdapter
extends Object
implements UMOLifecycleAdapter

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 static Log logger
          logger used by this class
 
Constructor Summary
DefaultLifecycleAdapter(Object component, UMODescriptor descriptor)
           
DefaultLifecycleAdapter(Object component, UMODescriptor descriptor, UMOEntryPointResolver epResolver)
           
 
Method Summary
protected  void configureNestedRouter()
           
 void dispose()
          A lifecycle method where implementor should free up any resources.
 UMODescriptor getDescriptor()
           
 void handleException(Object message, Exception e)
           
 void initialise()
          Method used to perform any initialisation work.
protected  void initialise(Object component, UMODescriptor descriptor, UMOEntryPointResolver epDiscovery)
           
 UMOMessage intercept(Invocation invocation)
          Invoked by the previous interceptor in the chain
 boolean isDisposed()
           
 boolean isStarted()
           
 void start()
           
 void stop()
           
 
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

Constructor Detail

DefaultLifecycleAdapter

public DefaultLifecycleAdapter(Object component,
                               UMODescriptor descriptor)
                        throws UMOException
Throws:
UMOException

DefaultLifecycleAdapter

public DefaultLifecycleAdapter(Object component,
                               UMODescriptor descriptor,
                               UMOEntryPointResolver epResolver)
                        throws UMOException
Throws:
UMOException
Method Detail

initialise

protected void initialise(Object component,
                          UMODescriptor descriptor,
                          UMOEntryPointResolver epDiscovery)
                   throws UMOException
Throws:
UMOException

start

public void start()
           throws UMOException
Specified by:
start in interface Startable
Throws:
UMOException

stop

public void stop()
          throws UMOException
Specified by:
stop in interface Stoppable
Throws:
UMOException

dispose

public void dispose()
Description copied from interface: Disposable
A lifecycle method where implementor should free up any resources. If an exception is thrown it should just be logged and processing should continue. This method should not throw Runtime exceptions.

Specified by:
dispose in interface Disposable

isStarted

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

isDisposed

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

getDescriptor

public UMODescriptor getDescriptor()
Specified by:
getDescriptor in interface UMOLifecycleAdapter

handleException

public void handleException(Object message,
                            Exception e)

intercept

public UMOMessage intercept(Invocation invocation)
                     throws UMOException
Description copied from interface: UMOInterceptor
Invoked by the previous interceptor in the chain

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

initialise

public void initialise()
                throws InitialisationException
Description copied from interface: Initialisable
Method used to perform any initialisation work. If a fatal error occurs during initialisation an InitialisationException should be thrown, causing the Mule instance to shutdown. If the error is recoverable, say by retrying to connect, a RecoverableException should be thrown. There is no guarantee that by throwing a Recoverable exception that the Mule instance will not shut down.

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 UMOException
Throws:
UMOException


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