1 package net.walend.somnifugi.test; 2 3 import javax.jms.JMSException ; 4 5 import net.walend.somnifugi.SomniExceptionListener; 6 7 8 13 public class TestExceptionListener 14 implements SomniExceptionListener 15 { 16 private volatile Exception caught = null; 17 18 public TestExceptionListener() 19 {} 20 21 26 public void onException(JMSException exception) 27 { 28 caught = exception; 29 } 30 31 36 public void onException(RuntimeException exception) 37 { 38 if(!caughtException()) 39 caught = exception; 40 } 41 42 public Exception getException() 43 { 44 return caught; 45 } 46 47 public boolean caughtException() 48 { 49 return null!=caught; 50 } 51 } 52 53 73 | Popular Tags |