Coverage Report - org.mule.service.ServiceAsyncReplyCompositeMessageSource
 
Classes in this File Line Coverage Branch Coverage Complexity
ServiceAsyncReplyCompositeMessageSource
0%
0/19
0%
0/4
0
 
 1  
 /*
 2  
  * $Id: ServiceAsyncReplyCompositeMessageSource.java 20320 2010-11-24 15:03:31Z dfeist $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.service;
 12  
 
 13  
 import org.mule.api.MuleException;
 14  
 import org.mule.api.processor.MessageProcessor;
 15  
 import org.mule.api.routing.Aggregator;
 16  
 import org.mule.management.stats.RouterStatistics;
 17  
 import org.mule.processor.chain.DefaultMessageProcessorChainBuilder;
 18  
 import org.mule.routing.AbstractAggregator;
 19  
 import org.mule.source.StartableCompositeMessageSource;
 20  
 
 21  
 /**
 22  
  * Extension of {@link StartableCompositeMessageSource} which adds message processors between the composite
 23  
  * source and the target listener
 24  
  */
 25  
 public class ServiceAsyncReplyCompositeMessageSource extends ServiceCompositeMessageSource
 26  
 {
 27  
     protected Long timeout;
 28  0
     protected boolean failOnTimeout = true;
 29  
 
 30  
     public ServiceAsyncReplyCompositeMessageSource()
 31  0
     {
 32  0
         statistics = new RouterStatistics(RouterStatistics.TYPE_RESPONSE);
 33  0
     }
 34  
 
 35  
     protected void createMessageProcessorChain() throws MuleException
 36  
     {
 37  0
         DefaultMessageProcessorChainBuilder builder = new DefaultMessageProcessorChainBuilder(flowConstruct);
 38  0
         builder.chain(processors);
 39  0
         builder.chain(listener);
 40  0
         listener = builder.build();
 41  0
     }
 42  
 
 43  
     public Long getTimeout()
 44  
     {
 45  0
         return timeout;
 46  
     }
 47  
 
 48  
     public void setTimeout(Long timeout)
 49  
     {
 50  0
         this.timeout = timeout;
 51  0
     }
 52  
 
 53  
     public boolean isFailOnTimeout()
 54  
     {
 55  0
         return failOnTimeout;
 56  
     }
 57  
 
 58  
     public void setFailOnTimeout(boolean failOnTimeout)
 59  
     {
 60  0
         this.failOnTimeout = failOnTimeout;
 61  0
     }
 62  
 
 63  
     public void expireAggregation(String groupId)
 64  
     {
 65  0
         for (MessageProcessor processor : processors)
 66  
         {
 67  0
             if (processor instanceof Aggregator)
 68  
             {
 69  0
                 ((AbstractAggregator) processor).expireAggregation(groupId);
 70  
             }
 71  
         }
 72  0
     }
 73  
 
 74  
 }