|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.construct.AbstractFlowConstruct
public abstract class AbstractFlowConstruct
Abstract implementation of FlowConstruct that:
MuleContext.
MessageSource as the source of messages.
MessageProcessors to process messages.
MessageSource and
MessageProcessors in the correct order depending on the lifecycle phase.
ExceptionListener to be set.
AbstractFlowConstuct should implement
configureMessageProcessors(org.mule.api.processor.MessageProcessorChainBuilder) and
validateConstruct() to construct the processing chain required and
validate the resulting construct. Validation may include validation of the type of
attributes of the MessageSource.
Implementations may also implement doInitialise(), doStart(),
doStop() and doDispose() if they need to perform any action on
lifecycle transitions.
| Field Summary | |
|---|---|
protected MessagingExceptionHandler |
exceptionListener
|
protected FlowConstructLifecycleManager |
lifecycleManager
|
protected Log |
logger
|
protected MessageInfoMapping |
messageInfoMapping
|
protected MessageProcessorChain |
messageProcessorChain
|
protected MessageSource |
messageSource
|
protected MuleContext |
muleContext
|
protected String |
name
|
protected FlowConstructStatistics |
statistics
|
protected ThreadingProfile |
threadingProfile
|
| 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 | |
|---|---|
AbstractFlowConstruct(String name,
MuleContext muleContext)
|
|
| Method Summary | |
|---|---|
protected abstract void |
configureMessageProcessors(MessageProcessorChainBuilder builder)
Used to configure the processing chain for this FlowConstuctMessageProcessors to the chain using the builder provided. |
protected void |
createMessageProcessor()
Creates a MessageProcessor that will process messages from the
configured MessageSource. |
void |
dispose()
A lifecycle method where implementor should free up any resources. |
protected void |
disposeIfDisposable(Object candidate)
|
protected void |
doDispose()
|
protected void |
doInitialise()
|
protected void |
doStart()
|
protected void |
doStop()
|
abstract String |
getConstructType()
|
MessagingExceptionHandler |
getExceptionListener()
|
LifecycleState |
getLifecycleState()
|
MessageInfoMapping |
getMessageInfoMapping()
|
MessageProcessorChain |
getMessageProcessorChain()
|
MessageSource |
getMessageSource()
|
MuleContext |
getMuleContext()
|
String |
getName()
|
FlowConstructStatistics |
getStatistics()
|
ThreadingProfile |
getThreadingProfile()
|
void |
initialise()
Method used to perform any initialisation work. |
protected void |
initialiseIfInitialisable(Object candidate)
|
protected void |
injectFlowConstructMuleContext(Object candidate)
|
boolean |
isStarted()
|
boolean |
isStopped()
|
boolean |
isStopping()
|
void |
setExceptionListener(MessagingExceptionHandler exceptionListener)
|
void |
setMessageInfoMapping(MessageInfoMapping messageInfoMapping)
|
void |
setMessageSource(MessageSource messageSource)
|
void |
start()
|
protected void |
startIfStartable(Object candidate)
|
void |
stop()
|
protected void |
stopIfStoppable(Object candidate)
|
String |
toString()
|
protected void |
validateConstruct()
Validates configured flow construct |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected transient Log logger
protected String name
protected MessageSource messageSource
protected MessageProcessorChain messageProcessorChain
protected MessagingExceptionHandler exceptionListener
protected final FlowConstructLifecycleManager lifecycleManager
protected final MuleContext muleContext
protected FlowConstructStatistics statistics
protected MessageInfoMapping messageInfoMapping
protected ThreadingProfile threadingProfile
| Constructor Detail |
|---|
public AbstractFlowConstruct(String name,
MuleContext muleContext)
| Method Detail |
|---|
public final 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 shutdown
RecoverableException - if an error occurs that can be recovered from
public final void start()
throws MuleException
start in interface StartableMuleException
public final void stop()
throws MuleException
stop in interface StoppableMuleExceptionpublic final void dispose()
Disposable
dispose in interface Disposablepublic ThreadingProfile getThreadingProfile()
public boolean isStarted()
public boolean isStopped()
public boolean isStopping()
protected void createMessageProcessor()
throws MuleException
MessageProcessor that will process messages from the
configured MessageSource.
The default implementation of this methods uses a
DefaultMessageProcessorChainBuilder and allows a chain of
MessageProcessors to be configured using the
configureMessageProcessors(org.mule.api.processor.MessageProcessorChainBuilder)
method but if you wish to use another MessageProcessorBuilder or just
a single MessageProcessor then this method can be overridden and
return a single MessageProcessor instead.
MuleException
protected abstract void configureMessageProcessors(MessageProcessorChainBuilder builder)
throws MuleException
FlowConstuctMessageProcessors to the chain using the builder provided.
To use a different builder of to construct a composite
MessageProcessor manually override createMessageProcessor()
instead.
builder - instance of DefaultMessageProcessorChainBuilder
MuleExceptionpublic String getName()
getName in interface FlowConstructpublic MessagingExceptionHandler getExceptionListener()
getExceptionListener in interface FlowConstructpublic void setExceptionListener(MessagingExceptionHandler exceptionListener)
public LifecycleState getLifecycleState()
getLifecycleState in interface LifecycleStateEnabledpublic MuleContext getMuleContext()
public MessageSource getMessageSource()
public void setMessageSource(MessageSource messageSource)
public FlowConstructStatistics getStatistics()
getStatistics in interface FlowConstructpublic MessageInfoMapping getMessageInfoMapping()
getMessageInfoMapping in interface FlowConstructMessageInfoMapping used to control how
Important message information is pulled from the current message.public void setMessageInfoMapping(MessageInfoMapping messageInfoMapping)
protected void doInitialise()
throws InitialisationException
InitialisationException
protected void doStart()
throws MuleException
MuleException
protected void doStop()
throws MuleException
MuleExceptionprotected void doDispose()
protected void validateConstruct()
throws FlowConstructInvalidException
FlowConstructInvalidException - if the flow construct does not pass
validationprotected void injectFlowConstructMuleContext(Object candidate)
public String toString()
toString in class Object
protected void initialiseIfInitialisable(Object candidate)
throws InitialisationException
InitialisationException
protected void startIfStartable(Object candidate)
throws MuleException
MuleException
protected void stopIfStoppable(Object candidate)
throws MuleException
MuleExceptionprotected void disposeIfDisposable(Object candidate)
public MessageProcessorChain getMessageProcessorChain()
getMessageProcessorChain in interface FlowConstructpublic abstract String getConstructType()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||