1 46 package org.mr.api.simple; 47 48 import javax.jms.JMSException ; 49 50 51 52 61 public class SimpleException extends Exception { 62 public final static int ERROR_CLOSED_ACTOR = 0; 63 public final static int ERROR_INVALID_ARGUMENT = 1; 64 public final static int ERROR_OPERATION_TIMED_OUT = 2; 65 public final static int ERROR_SECURITY = 3; 66 public final static int ERROR_GENERAL_FAILURE = 4; 67 68 private int code; 69 70 public SimpleException(int code, String message) { 71 super(message); 72 this.code = code; 73 } 75 public SimpleException(JMSException e) { 76 super(e.getMessage()); 77 if (e instanceof javax.jms.JMSSecurityException ) { 78 this.code = ERROR_SECURITY; 79 } else { 80 this.code = ERROR_GENERAL_FAILURE; 81 } 82 } 83 84 88 public int getCode() { 89 return code; 90 } 91 } | Popular Tags |