public class StartableCompositeMessageSource extends Object implements CompositeMessageSource, Lifecycle, FlowConstructAware, MuleContextAware
CompositeMessageSource that propagates both injection of FlowConstruct
and lifecycle to nested MessageSources.
MessageSource is started in isolation when composite is stopped then messages will be
lost.
| Modifier and Type | Field and Description |
|---|---|
protected FlowConstruct |
flowConstruct |
protected AtomicBoolean |
initialised |
protected MessageProcessor |
listener |
protected static org.apache.commons.logging.Log |
log |
protected MuleContext |
muleContext |
protected List<MessageSource> |
sources |
protected AtomicBoolean |
started |
protected AtomicBoolean |
starting |
PHASE_NAMEPHASE_NAMEPHASE_NAMEPHASE_NAME| Constructor and Description |
|---|
StartableCompositeMessageSource() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSource(MessageSource source) |
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
List<MessageSource> |
getSources() |
void |
initialise()
Method used to perform any initialisation work.
|
void |
removeSource(MessageSource source) |
void |
setFlowConstruct(FlowConstruct pattern) |
void |
setListener(MessageProcessor listener)
Set the MessageProcessor listener on a message source which will be invoked
when a message is received or generated.
|
void |
setMessageSources(List<MessageSource> sources) |
void |
setMuleContext(MuleContext context) |
void |
start() |
void |
stop() |
String |
toString() |
protected static final org.apache.commons.logging.Log log
protected MessageProcessor listener
protected AtomicBoolean initialised
protected AtomicBoolean started
protected final List<MessageSource> sources
protected AtomicBoolean starting
protected FlowConstruct flowConstruct
protected MuleContext muleContext
public void addSource(MessageSource source) throws MuleException
addSource in interface CompositeMessageSourceMuleExceptionpublic void removeSource(MessageSource source) throws MuleException
removeSource in interface CompositeMessageSourceMuleExceptionpublic void setMessageSources(List<MessageSource> sources) throws MuleException
MuleExceptionpublic void initialise()
throws InitialisationException
InitialisableInitialisationException 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 InitialisableInitialisationException - 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 StartableMuleExceptionpublic void stop()
throws MuleException
stop in interface StoppableMuleExceptionpublic void dispose()
Disposabledispose in interface Disposablepublic void setListener(MessageProcessor listener)
MessageSourcesetListener in interface MessageSourcepublic void setFlowConstruct(FlowConstruct pattern)
setFlowConstruct in interface FlowConstructAwarepublic List<MessageSource> getSources()
getSources in interface CompositeMessageSourcepublic void setMuleContext(MuleContext context)
setMuleContext in interface MuleContextAwareCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.