protected boolean canProcessAsync(MuleEvent event) throws MessagingException { return !(event.isSynchronous() || event.isTransacted() || event.getReplyToHandler() instanceof NonBlockingReplyToHandler); }
public DefaultMuleEvent(MuleEvent rewriteEvent, FlowConstruct flowConstruct) { this(rewriteEvent.getMessage(), rewriteEvent, flowConstruct, rewriteEvent.getSession(), rewriteEvent.isSynchronous()); }
public DefaultMuleEvent(MuleEvent rewriteEvent, FlowConstruct flowConstruct, ReplyToHandler replyToHandler, Object replyToDestination) { this(rewriteEvent.getMessage(), rewriteEvent, flowConstruct, rewriteEvent.getSession(), rewriteEvent.isSynchronous(), replyToHandler, replyToDestination, true, rewriteEvent.getExchangePattern()); }
protected DefaultMuleEvent(MuleMessage message, MuleEvent rewriteEvent, FlowConstruct flowConstruct, MuleSession session, boolean synchronous) { this(message, rewriteEvent, flowConstruct, session, synchronous, rewriteEvent.getReplyToHandler(), rewriteEvent.getReplyToDestination(), true, rewriteEvent.getExchangePattern()); }
private MuleEvent createReturnEventForParentFlowConstruct(MuleEvent result, MuleEvent original) { if (result != null && !(result instanceof VoidMuleEvent)) { // Create new event with original FlowConstruct, ReplyToHandler and synchronous result = new DefaultMuleEvent(result, original.getFlowConstruct(), original.getReplyToHandler(), original.getReplyToDestination(), original.isSynchronous()); } resetRequestContextEvent(result); return result; }
private MuleEvent createMuleEventForCurrentFlow(MuleEvent event, Object replyToDestination, ReplyToHandler replyToHandler) { // Wrap and propagte reply to handler only if it's not a standard DefaultReplyToHandler. if (replyToHandler != null && replyToHandler instanceof NonBlockingReplyToHandler) { replyToHandler = createNonBlockingReplyToHandler(event, replyToHandler); } else { // DefaultReplyToHandler is used differently and should only be invoked by the first flow and not any // referenced flows. If it is passded on they two replyTo responses are sent. replyToHandler = null; } // Create new event for current flow with current flowConstruct, replyToHandler etc. event = new DefaultMuleEvent(event, this, replyToHandler, replyToDestination, event.isSynchronous() || isSynchronous()); resetRequestContextEvent(event); return event; }
/** * Watermark route preparation carries the value from the source event to the * flow event */ @Override public MuleEvent prepareRouting(MuleEvent sourceEvent, MuleEvent event) throws ConfigurationException { if (!event.isSynchronous()) { throw new ConfigurationException(CoreMessages.watermarkRequiresSynchronousProcessing()); } String variableName = this.watermark.resolveVariable(event); event.setFlowVariable(variableName, sourceEvent.getFlowVariable(variableName)); return event; }