| 1 | package tmcsim.common; |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | /** |
|---|
| 6 | * Exception class used to handle exceptions thrown within the CAD Simulation |
|---|
| 7 | * software relating to connection and initialization errors. Each error is |
|---|
| 8 | * defined by this class' public static final Strings. |
|---|
| 9 | * |
|---|
| 10 | * @author Matthew Cechini (mcechini@calpoly.edu) |
|---|
| 11 | * @version $Date: 2006/06/06 20:46:41 $ $Revision: 1.7 |
|---|
| 12 | */ |
|---|
| 13 | @SuppressWarnings("serial") |
|---|
| 14 | public class SimulationException extends Exception { |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | /** |
|---|
| 18 | * Exception error when a socket or RMI connection to the CAD Simulator fails.<br> |
|---|
| 19 | * Error Message: "Unable to connect to the CAD Simulator." |
|---|
| 20 | */ |
|---|
| 21 | public static final String CAD_SIM_CONNECT = "Unable to connect to the CAD Server. "+ |
|---|
| 22 | "Check that server is running at "; |
|---|
| 23 | |
|---|
| 24 | /** |
|---|
| 25 | * Exception error when a socket or RMI communication to the CAD Simulator fails.<br> |
|---|
| 26 | * Error Message: "Unable to communicate with the CAD Simulator." |
|---|
| 27 | */ |
|---|
| 28 | public static final String CAD_SIM_COMM = "Unable to communicate with the CAD Server."; |
|---|
| 29 | |
|---|
| 30 | /** |
|---|
| 31 | * An error has occured in binding to a socket or rmi port.<br> |
|---|
| 32 | * Error Message: "An error has occured in establishing communications." |
|---|
| 33 | */ |
|---|
| 34 | public static final String BINDING = "An error has occured in establishing communications."; |
|---|
| 35 | |
|---|
| 36 | /** |
|---|
| 37 | * Exception error when initialization of an object from a properties file fails.<br> |
|---|
| 38 | * Error Message: "Unable to complete initialization, program exiting." |
|---|
| 39 | */ |
|---|
| 40 | public static final String INITIALIZE_ERROR = "Unable to complete initialization, program exiting."; |
|---|
| 41 | /** |
|---|
| 42 | * Exception error when reading a properties file fails.<br> |
|---|
| 43 | */ |
|---|
| 44 | public static final String PROPERTY_READ_ERROR = "Error reading CAD Server properties file. "; |
|---|
| 45 | public static final String PROPERTY_MISSING_ERROR = "Missing property for CAD Server user interface. "; |
|---|
| 46 | public static final String INSTANTIATION_FAILURE = "Unable to instantiate CAD Server user interface. "; |
|---|
| 47 | |
|---|
| 48 | /** |
|---|
| 49 | * Exception error when registering the CAD Client with the CAD Simulator fails.<br> |
|---|
| 50 | * Error Message: "Unable to complete CAD Client registration, program exiting." |
|---|
| 51 | */ |
|---|
| 52 | public static final String REGISTER_ERROR = "Unable to complete CAD Client registration, program exiting."; |
|---|
| 53 | |
|---|
| 54 | /** |
|---|
| 55 | * Exception error if the SimulationManagerModel is initialized without |
|---|
| 56 | * the view componenta socket or RMI connection to the CAD Simulator fails.<br> |
|---|
| 57 | * Error Message: "Unable to connect to the CAD Simulator." |
|---|
| 58 | */ |
|---|
| 59 | public static final String NULL_VIEW = "Unable to connect to the CAD Server."; |
|---|
| 60 | |
|---|
| 61 | /** |
|---|
| 62 | * Exception error when a connection to the ATMS server cannot be established.<br> |
|---|
| 63 | * Error Message: "A connection to the ATMS server could not be established" |
|---|
| 64 | */ |
|---|
| 65 | public static final String ATMS_UNREACHABLE = "A connection to the ATMS server could not be established"; |
|---|
| 66 | |
|---|
| 67 | /** |
|---|
| 68 | * Exception error to notify the user that a connection to Paramics has |
|---|
| 69 | * not been established.<br> |
|---|
| 70 | * Error Message: "A connection to Paramics has not been established." |
|---|
| 71 | */ |
|---|
| 72 | public static final String PARAMICS_NOT_CONNECTED = "A connection to Paramics has not been established."; |
|---|
| 73 | |
|---|
| 74 | /** |
|---|
| 75 | * Exception error when there is an error parsing the script file.<br> |
|---|
| 76 | * Error Message: "Unable to parse the script file." |
|---|
| 77 | */ |
|---|
| 78 | public static final String INVALID_SCRIPT_FILE = "Unable to parse the script file."; |
|---|
| 79 | |
|---|
| 80 | /** |
|---|
| 81 | * Constructor accepting a String message. |
|---|
| 82 | * |
|---|
| 83 | * @param newMessage Exception message |
|---|
| 84 | */ |
|---|
| 85 | public SimulationException(String newMessage) { |
|---|
| 86 | super(newMessage); |
|---|
| 87 | } |
|---|
| 88 | |
|---|
| 89 | /** |
|---|
| 90 | * Constructor accepting a String message and Throwable cause. |
|---|
| 91 | * |
|---|
| 92 | * @param newMessage Exception message |
|---|
| 93 | * @param e Cause of the exception. |
|---|
| 94 | */ |
|---|
| 95 | public SimulationException(String newMessage, Throwable e) { |
|---|
| 96 | super(newMessage, e); |
|---|
| 97 | } |
|---|
| 98 | |
|---|
| 99 | /** |
|---|
| 100 | * Constructor accepting a String message, additional info object, and Throwable cause. |
|---|
| 101 | * |
|---|
| 102 | * @param newMessage Exception message |
|---|
| 103 | * @param addlInfo Additional info |
|---|
| 104 | * @param e Cause of the exception. |
|---|
| 105 | */ |
|---|
| 106 | public SimulationException(String newMessage, Object addlInfo, Throwable e) { |
|---|
| 107 | super(newMessage + " <" + addlInfo.toString() + ">", e); |
|---|
| 108 | } |
|---|
| 109 | |
|---|
| 110 | |
|---|
| 111 | } |
|---|