org.mule.routing.requestreply
Class AbstractAsyncRequestReplyRequester

java.lang.Object
  extended by org.mule.processor.AbstractInterceptingMessageProcessor
      extended by org.mule.routing.requestreply.AbstractAsyncRequestReplyRequester
All Implemented Interfaces:
InterceptingMessageProcessor, MessageProcessor, RequestReplyRequesterMessageProcessor, MessageSource
Direct Known Subclasses:
ServiceAsyncRequestReplyRequestor, SimpleAsyncRequestReplyRequester

public abstract class AbstractAsyncRequestReplyRequester
extends AbstractInterceptingMessageProcessor
implements RequestReplyRequesterMessageProcessor


Field Summary
protected  boolean failOnTimeout
           
protected  FlowConstruct flowConstruct
           
protected  edu.emory.mathcs.backport.java.util.concurrent.ConcurrentMap locks
           
static int MAX_PROCESSED_GROUPS
           
protected  BoundedFifoBuffer processed
           
protected  java.lang.Object processedLock
           
protected  MessageSource replyMessageSource
           
protected  edu.emory.mathcs.backport.java.util.concurrent.ConcurrentMap responseEvents
           
protected  long timeout
           
 
Fields inherited from class org.mule.processor.AbstractInterceptingMessageProcessor
logger, next
 
Constructor Summary
AbstractAsyncRequestReplyRequester()
           
 
Method Summary
protected  void addProcessed(java.lang.Object id)
           
protected  java.lang.String getAsyncReplyCorrelationId(MuleEvent event)
           
protected  boolean isAlreadyProcessed(java.lang.Object id)
           
protected  void postLatchAwait(java.lang.String asyncReplyCorrelationId)
           
 MuleEvent process(MuleEvent event)
          Invokes the MessageProcessor.
protected  MuleEvent receiveAsyncReply(MuleEvent event)
           
protected  void sendAsyncRequest(MuleEvent event)
           
 void setFailOnTimeout(boolean failOnTimeout)
           
 void setReplySource(MessageSource messageSource)
           
 void setTimeout(long timeout)
           
 java.lang.String toString()
           
protected  void verifyReplyMessageSource(MessageSource messageSource)
           
 
Methods inherited from class org.mule.processor.AbstractInterceptingMessageProcessor
processNext, setListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.source.MessageSource
setListener
 

Field Detail

MAX_PROCESSED_GROUPS

public static final int MAX_PROCESSED_GROUPS
See Also:
Constant Field Values

timeout

protected volatile long timeout

failOnTimeout

protected volatile boolean failOnTimeout

replyMessageSource

protected MessageSource replyMessageSource

flowConstruct

protected FlowConstruct flowConstruct

locks

protected final edu.emory.mathcs.backport.java.util.concurrent.ConcurrentMap locks

responseEvents

protected final edu.emory.mathcs.backport.java.util.concurrent.ConcurrentMap responseEvents

processedLock

protected final java.lang.Object processedLock

processed

protected final BoundedFifoBuffer processed
Constructor Detail

AbstractAsyncRequestReplyRequester

public AbstractAsyncRequestReplyRequester()
Method Detail

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

verifyReplyMessageSource

protected void verifyReplyMessageSource(MessageSource messageSource)

getAsyncReplyCorrelationId

protected java.lang.String getAsyncReplyCorrelationId(MuleEvent event)

sendAsyncRequest

protected void sendAsyncRequest(MuleEvent event)
                         throws MuleException
Throws:
MuleException

receiveAsyncReply

protected MuleEvent receiveAsyncReply(MuleEvent event)
                               throws ResponseTimeoutException
Throws:
ResponseTimeoutException

postLatchAwait

protected void postLatchAwait(java.lang.String asyncReplyCorrelationId)

addProcessed

protected void addProcessed(java.lang.Object id)

isAlreadyProcessed

protected boolean isAlreadyProcessed(java.lang.Object id)

toString

public java.lang.String toString()
Overrides:
toString in class AbstractInterceptingMessageProcessor


Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.