public abstract class AbstractAsyncRequestReplyRequester extends AbstractInterceptingMessageProcessorBase implements RequestReplyRequesterMessageProcessor, FlowConstructAware, Initialisable, Startable, Stoppable, Disposable
Modifier and Type | Field and Description |
---|---|
protected boolean |
failOnTimeout |
protected FlowConstruct |
flowConstruct |
protected Map<String,Latch> |
locks |
static int |
MAX_PROCESSED_GROUPS |
protected String |
name |
static String |
NAME_TEMPLATE |
protected org.apache.commons.collections.buffer.BoundedFifoBuffer |
processed |
protected Object |
processedLock |
protected MessageSource |
replyMessageSource |
protected ConcurrentMap<String,MuleEvent> |
responseEvents |
protected ListableObjectStore |
store |
protected long |
timeout |
static int |
UNCLAIMED_INTERVAL |
static int |
UNCLAIMED_TIME_TO_LIVE |
logger, muleContext, next, notificationHandler
PHASE_NAME
PHASE_NAME
PHASE_NAME
PHASE_NAME
PROPERTY_NAME
Constructor and Description |
---|
AbstractAsyncRequestReplyRequester() |
Modifier and Type | Method and Description |
---|---|
protected void |
addProcessed(Object id) |
protected Latch |
createEventLock()
Creates the lock used to synchronize a given event
|
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
protected String |
getAsyncReplyCorrelationId(MuleEvent event) |
void |
initialise()
Method used to perform any initialisation work.
|
protected boolean |
isAlreadyProcessed(Object id) |
protected void |
postLatchAwait(String asyncReplyCorrelationId) |
MuleEvent |
process(MuleEvent event)
Invokes the MessageProcessor.
|
protected MuleEvent |
receiveAsyncReply(MuleEvent event) |
protected void |
sendAsyncRequest(MuleEvent event) |
void |
setFailOnTimeout(boolean failOnTimeout) |
void |
setFlowConstruct(FlowConstruct flowConstruct) |
void |
setReplySource(MessageSource messageSource) |
void |
setStorePrefix(String storePrefix) |
void |
setTimeout(long timeout) |
void |
start() |
void |
stop() |
String |
toString() |
protected void |
verifyReplyMessageSource(MessageSource messageSource) |
addMessageProcessorPathElements, getAnnotation, getAnnotations, getListener, getMuleContext, isEventValid, processNext, setAnnotations, setListener, setMuleContext
public static final int MAX_PROCESSED_GROUPS
public static final int UNCLAIMED_TIME_TO_LIVE
public static int UNCLAIMED_INTERVAL
public static final String NAME_TEMPLATE
protected String name
protected volatile long timeout
protected volatile boolean failOnTimeout
protected MessageSource replyMessageSource
protected FlowConstruct flowConstruct
protected final ConcurrentMap<String,MuleEvent> responseEvents
protected final Object processedLock
protected final org.apache.commons.collections.buffer.BoundedFifoBuffer processed
protected ListableObjectStore store
public MuleEvent process(MuleEvent event) throws MuleException
MessageProcessor
process
in interface MessageProcessor
event
- MuleEvent to be processedMuleException
protected Latch createEventLock()
public void setTimeout(long timeout)
public void setFailOnTimeout(boolean failOnTimeout)
public void setReplySource(MessageSource messageSource)
setReplySource
in interface RequestReplyRequesterMessageProcessor
messageSource
- the message source that will be used to receive the reply messagepublic 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 setStorePrefix(String storePrefix)
protected void verifyReplyMessageSource(MessageSource messageSource)
protected void sendAsyncRequest(MuleEvent event) throws MuleException
MuleException
protected MuleEvent receiveAsyncReply(MuleEvent event) throws MessagingException
MessagingException
protected void postLatchAwait(String asyncReplyCorrelationId) throws MessagingException
MessagingException
protected void addProcessed(Object id)
protected boolean isAlreadyProcessed(Object id)
public String toString()
toString
in class AbstractInterceptingMessageProcessorBase
public void setFlowConstruct(FlowConstruct flowConstruct)
setFlowConstruct
in interface FlowConstructAware
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.