public class ClusterizableMessageSourceWrapper extends Object implements MessageSource, Lifecycle, MuleContextAware, FlowConstructAware
ClusterizableMessageSource
in order to manage the lifecycle
of the wrapped instance differently depending if the node is primary or not
inside a cluster. Non clustered nodes are always primary.Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
logger |
PHASE_NAME
PHASE_NAME
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
ClusterizableMessageSourceWrapper(ClusterizableMessageSource messageSource) |
ClusterizableMessageSourceWrapper(MuleContext muleContext,
ClusterizableMessageSource messageSource,
FlowConstruct flowConstruct) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
void |
initialise()
Method used to perform any initialisation work.
|
boolean |
isStarted() |
void |
setFlowConstruct(FlowConstruct flowConstruct) |
void |
setListener(MessageProcessor listener)
Set the MessageProcessor listener on a message source which will be invoked
when a message is received or generated.
|
void |
setMuleContext(MuleContext context) |
void |
start() |
void |
stop() |
public ClusterizableMessageSourceWrapper(ClusterizableMessageSource messageSource)
public ClusterizableMessageSourceWrapper(MuleContext muleContext, ClusterizableMessageSource messageSource, FlowConstruct flowConstruct)
public void setListener(MessageProcessor listener)
MessageSource
setListener
in interface MessageSource
public void initialise() throws InitialisationException
Initialisable
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.initialise
in interface Initialisable
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdownRecoverableException
- if an error occurs that can be recovered frompublic void start() throws MuleException
start
in interface Startable
MuleException
public void stop() throws MuleException
stop
in interface Stoppable
MuleException
public void dispose()
Disposable
dispose
in interface Disposable
public void setFlowConstruct(FlowConstruct flowConstruct)
setFlowConstruct
in interface FlowConstructAware
public void setMuleContext(MuleContext context)
setMuleContext
in interface MuleContextAware
public boolean isStarted()
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.