1 package net.innig.macker.event; 2 3 import org.apache.commons.lang.exception.NestableException; 4 5 public class ListenerException 6 extends NestableException 7 { 8 public ListenerException(MackerEventListener listener, String message) 9 { 10 super(createMessage(listener, message)); 11 this.listener = listener; 12 } 13 14 public ListenerException(MackerEventListener listener, String message, Throwable cause) 15 { 16 super(createMessage(listener, message), cause); 17 this.listener = listener; 18 } 19 20 public MackerEventListener getListener() 21 { return listener; } 22 23 private static String createMessage(MackerEventListener listener, String message) 24 { return "Aborted by " + listener + ": " + message; } 25 26 private final MackerEventListener listener; 27 } 28 | Popular Tags |