View Javadoc
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.tck;
8   
9   import org.mule.work.DefaultWorkListener;
10  
11  import javax.resource.spi.work.WorkEvent;
12  
13  public class TestingWorkListener extends DefaultWorkListener
14  {
15      protected void handleWorkException(WorkEvent event, String type)
16      {
17          super.handleWorkException(event, type);
18          if (event.getException() != null)
19          {
20              Throwable t = event.getException().getCause();
21              if (t != null)
22              {
23  
24                  if (t instanceof Error)
25                  {
26                      throw (Error)t;
27                  }
28                  else if (t instanceof RuntimeException)
29                  {
30                      throw (RuntimeException)t;
31                  }
32              }
33  
34          }
35      }
36  }