1   /*
2    * $Id: RollbackRoutingExceptionStrategy.java 11468 2008-03-21 17:54:46Z rossmason $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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  package org.mule.test.integration.transaction;
11  
12  import org.mule.DefaultExceptionStrategy;
13  import org.mule.api.MuleMessage;
14  import org.mule.api.endpoint.ImmutableEndpoint;
15  
16  /**
17   * Will rollback the transaction in case a {@link org.mule.api.routing.RoutingException}
18   * is encountered. Typically used with {@link org.mule.routing.outbound.TransactionJoiningRouter}
19   * and configured on a connector.
20   */
21  public class RollbackRoutingExceptionStrategy extends DefaultExceptionStrategy
22  {
23  
24      public void handleRoutingException(MuleMessage message, ImmutableEndpoint 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  }