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, notificationHandlerPHASE_NAMEPHASE_NAMEPHASE_NAMEPHASE_NAMEPROPERTY_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, getListener, getMuleContext, isEventValid, processNext, setListener, setMuleContextgetAnnotation, getAnnotations, setAnnotationspublic 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
MessageProcessorprocess in interface MessageProcessorevent - MuleEvent to be processedMuleExceptionprotected Latch createEventLock()
public void setTimeout(long timeout)
public void setFailOnTimeout(boolean failOnTimeout)
public void setReplySource(MessageSource messageSource)
setReplySource in interface RequestReplyRequesterMessageProcessormessageSource - the message source that will be used to receive the reply messagepublic 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 setStorePrefix(String storePrefix)
protected void verifyReplyMessageSource(MessageSource messageSource)
protected void sendAsyncRequest(MuleEvent event) throws MuleException
MuleExceptionprotected MuleEvent receiveAsyncReply(MuleEvent event) throws MessagingException
MessagingExceptionprotected void postLatchAwait(String asyncReplyCorrelationId) throws MessagingException
MessagingExceptionprotected void addProcessed(Object id)
protected boolean isAlreadyProcessed(Object id)
public String toString()
toString in class AbstractInterceptingMessageProcessorBasepublic void setFlowConstruct(FlowConstruct flowConstruct)
setFlowConstruct in interface FlowConstructAwareCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.