1 package org.columba.core.command; 17 18 import java.lang.reflect.InvocationTargetException ; 19 import java.lang.reflect.Method ; 20 21 26 public class CommandCancelledException extends Exception { 27 30 private static final long serialVersionUID = 7444994996504305731L; 31 32 35 public CommandCancelledException() { 36 super(); 37 } 38 39 44 public CommandCancelledException(String message) { 45 super(message); 46 } 47 48 54 public CommandCancelledException(String message, Throwable cause) { 55 this(message); 56 compatibleInitCause(cause); 57 } 58 59 64 public CommandCancelledException(Throwable cause) { 65 this(); 66 compatibleInitCause(cause); 67 } 68 69 private void compatibleInitCause(Throwable cause) { 70 try { 71 Method initCause = getClass().getMethod( 72 "initCause", new Class [] { Throwable .class }); initCause.invoke(this, new Object [] { cause }); 74 } catch (NoSuchMethodException nsme) { 75 } catch (IllegalAccessException iae) { 77 } catch (InvocationTargetException ite) { 79 } 81 } 82 } 83 | Popular Tags |