org.mule.routing.requestreply
Class AbstractAsyncRequestReplyRequester
java.lang.Object
org.mule.processor.AbstractInterceptingMessageProcessorBase
org.mule.routing.requestreply.AbstractAsyncRequestReplyRequester
- All Implemented Interfaces:
- AnnotatedObject, FlowConstructAware, MuleContextAware, Disposable, Initialisable, Startable, Stoppable, MessageProcessor, RequestReplyRequesterMessageProcessor
- Direct Known Subclasses:
- ServiceAsyncRequestReplyRequestor, SimpleAsyncRequestReplyRequester
public abstract class AbstractAsyncRequestReplyRequester
- extends AbstractInterceptingMessageProcessorBase
- implements RequestReplyRequesterMessageProcessor, FlowConstructAware, Initialisable, Startable, Stoppable, Disposable
MAX_PROCESSED_GROUPS
public static final int MAX_PROCESSED_GROUPS
- See Also:
- Constant Field Values
UNCLAIMED_TIME_TO_LIVE
public static final int UNCLAIMED_TIME_TO_LIVE
- See Also:
- Constant Field Values
UNCLAIMED_INTERVAL
public static int UNCLAIMED_INTERVAL
NAME_TEMPLATE
public static final String NAME_TEMPLATE
- See Also:
- Constant Field Values
name
protected String name
timeout
protected volatile long timeout
failOnTimeout
protected volatile boolean failOnTimeout
replyMessageSource
protected MessageSource replyMessageSource
flowConstruct
protected FlowConstruct flowConstruct
locks
protected final Map<String,Latch> locks
responseEvents
protected final ConcurrentMap<String,MuleEvent> responseEvents
processedLock
protected final Object processedLock
processed
protected final BoundedFifoBuffer processed
store
protected ListableObjectStore store
AbstractAsyncRequestReplyRequester
public AbstractAsyncRequestReplyRequester()
process
public MuleEvent process(MuleEvent event)
throws MuleException
- Description copied from interface:
MessageProcessor
- Invokes the MessageProcessor.
- Specified by:
process
in interface MessageProcessor
- Parameters:
event
- MuleEvent to be processed
- Returns:
- optional response MuleEvent
- Throws:
MuleException
setTimeout
public void setTimeout(long timeout)
setFailOnTimeout
public void setFailOnTimeout(boolean failOnTimeout)
setReplySource
public void setReplySource(MessageSource messageSource)
- Specified by:
setReplySource
in interface RequestReplyRequesterMessageProcessor
- Parameters:
messageSource
- the message source that will be used to receive the reply message
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
start
public void start()
throws MuleException
- Specified by:
start
in interface Startable
- Throws:
MuleException
stop
public void stop()
throws MuleException
- Specified by:
stop
in interface Stoppable
- Throws:
MuleException
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
setStorePrefix
public void setStorePrefix(String storePrefix)
verifyReplyMessageSource
protected void verifyReplyMessageSource(MessageSource messageSource)
getAsyncReplyCorrelationId
protected String getAsyncReplyCorrelationId(MuleEvent event)
sendAsyncRequest
protected void sendAsyncRequest(MuleEvent event)
throws MuleException
- Throws:
MuleException
receiveAsyncReply
protected MuleEvent receiveAsyncReply(MuleEvent event)
throws MessagingException
- Throws:
MessagingException
postLatchAwait
protected void postLatchAwait(String asyncReplyCorrelationId)
throws MessagingException
- Throws:
MessagingException
addProcessed
protected void addProcessed(Object id)
isAlreadyProcessed
protected boolean isAlreadyProcessed(Object id)
toString
public String toString()
- Overrides:
toString
in class AbstractInterceptingMessageProcessorBase
setFlowConstruct
public void setFlowConstruct(FlowConstruct flowConstruct)
- Specified by:
setFlowConstruct
in interface FlowConstructAware
Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.