View Javadoc

1   /*
2    * $Id: RollbackRoutingExceptionStrategy.java 19692 2010-09-21 23:50:35Z aperepel $
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.test.integration.transaction;
12  
13  import org.mule.api.MuleMessage;
14  import org.mule.api.processor.MessageProcessor;
15  import org.mule.api.routing.RoutingException;
16  import org.mule.exception.AbstractMessagingExceptionStrategy;
17  
18  /**
19   * Will rollback the transaction in case a {@link RoutingException} is encountered.
20   */
21  public class RollbackRoutingExceptionStrategy extends AbstractMessagingExceptionStrategy
22  {
23  
24      public void handleRoutingException(MuleMessage message, MessageProcessor endpoint, Throwable t)
25      {
26          logger.debug("handleRoutingException: endpoint=" + endpoint + " message=" + message);
27          defaultHandler(t);
28          handleTransaction(t);
29          routeException(message, endpoint, t);
30      }
31  
32  }