Coverage Report - org.mule.routing.ServiceCatchAllStrategy
 
Classes in this File Line Coverage Branch Coverage Complexity
ServiceCatchAllStrategy
0%
0/14
0%
0/8
0
 
 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;
 8  
 
 9  
 import org.mule.api.MuleEvent;
 10  
 import org.mule.api.MuleException;
 11  
 import org.mule.api.routing.RoutingException;
 12  
 import org.mule.api.service.Service;
 13  
 
 14  
 /**
 15  
  * <code>ServiceCatchAllStrategy</code> is used to catch any events and forward the
 16  
  * events to the service as is.
 17  
  * @deprecated
 18  
  */
 19  
 @Deprecated
 20  0
 public class ServiceCatchAllStrategy extends AbstractCatchAllStrategy
 21  
 {
 22  
     @Override
 23  
     public synchronized MuleEvent doCatchMessage(MuleEvent event)
 24  
         throws RoutingException
 25  
     {
 26  0
         if (!(event.getFlowConstruct() instanceof Service))
 27  
         {
 28  0
             throw new UnsupportedOperationException(
 29  
                 "CollectionResponseWithCallbackCorrelator is only supported with Service");
 30  
         }
 31  
 
 32  0
         logger.debug("Catch all strategy handling event: " + event);
 33  
         try
 34  
         {
 35  0
             if (event.getEndpoint().getExchangePattern().hasResponse())
 36  
             {
 37  0
                 if (statistics.isEnabled())
 38  
                 {
 39  0
                     statistics.incrementRoutedMessage(event.getEndpoint());
 40  
                 }
 41  0
                 return ((Service) event.getFlowConstruct()).sendEvent(event);
 42  
             }
 43  
             else
 44  
             {
 45  0
                 if (statistics.isEnabled())
 46  
                 {
 47  0
                     statistics.incrementRoutedMessage(event.getEndpoint());
 48  
                 }
 49  0
                 ((Service) event.getFlowConstruct()).dispatchEvent(event);
 50  0
                 return null;
 51  
             }
 52  
         }
 53  0
         catch (MuleException e)
 54  
         {
 55  0
             throw new RoutingException(event, this, e);
 56  
         }
 57  
     }
 58  
 }