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