Coverage Report - org.mule.routing.requestreply.ReplyToAsyncProcessor
 
Classes in this File Line Coverage Branch Coverage Complexity
ReplyToAsyncProcessor
0%
0/9
0%
0/8
2
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.routing.requestreply;
 8  
 
 9  
 import org.mule.api.MessagingException;
 10  
 import org.mule.api.MuleEvent;
 11  
 import org.mule.api.MuleException;
 12  
 import org.mule.api.config.MuleProperties;
 13  
 
 14  
 /**
 15  
  * ReplyToMessageProcessor for async flow.
 16  
  * <p/>
 17  
  * In synchronous flows will skip execution
 18  
  */
 19  0
 public class ReplyToAsyncProcessor extends ReplyToMessageProcessor
 20  
 
 21  
 {
 22  
 
 23  
     public MuleEvent process(MuleEvent event) throws MuleException
 24  
     {
 25  0
         if (shouldProcessEvent(event))
 26  
         {
 27  0
             return super.process(event);
 28  
         }
 29  
         else
 30  
         {
 31  0
             return processNext(event);
 32  
         }
 33  
     }
 34  
 
 35  
     protected boolean shouldProcessEvent(final MuleEvent event) throws MessagingException
 36  
     {
 37  0
         Object messageProperty = event.getMessage().getInboundProperty(MuleProperties.MULE_FORCE_SYNC_PROPERTY);
 38  0
         boolean forceSync = Boolean.TRUE.equals(messageProperty);
 39  
 
 40  0
         boolean hasResponse = event.getEndpoint().getExchangePattern().hasResponse();
 41  0
         boolean isTransacted = event.getEndpoint().getTransactionConfig().isTransacted();
 42  
 
 43  0
         return !forceSync && !hasResponse && !isTransacted;
 44  
     }
 45  
 
 46  
 }