| java.lang.Object org.apache.wsrp4j.exception.WSRPXHelper
WSRPXHelper | public class WSRPXHelper (Code) | | Handles the throwing of exceptions.
Instead of calling throw(new WSRPException("exception text"))
simply type ExceptionHelper throwX(1234)
So the appropriate messages can be handled in a central place.
Also the Exceptions will be logged
|
Method Summary | |
protected static WSRPException | getException(int errorCode, Throwable t) Returns an Exception. | public static void | handleWSRPException(WSRPException exception) | public static void | handleWSRPFault(Logger logger, java.rmi.RemoteException wsrpFault) | public static void | throwX(int errorCode) | public static void | throwX(int errorCode, Throwable t) | public static void | throwX(Logger logger, int logLevel, String method, int errorCode) Throws a new exception with a specific message
identified by an error code and logs the exception
to a logger. | public static void | throwX(Logger logger, int logLevel, String method, int errorCode, Throwable t) Throws a new exception with a specific message
identified by an error code and logs the exception
to a logger. |
getException | protected static WSRPException getException(int errorCode, Throwable t)(Code) | | Returns an Exception. The type of the Exception depends on the error code that is passed to the method.
Parameters: errorCode - integer specifying an error message Exception. The type depends on the error code |
handleWSRPException | public static void handleWSRPException(WSRPException exception) throws java.rmi.RemoteException(Code) | | This method translates a WSRP exception into an
apropriate WSRP fault according to the error code
Parameters: exception - the WSRPException to be translated exception: java.rmi.RemoteException - the translated fault |
handleWSRPFault | public static void handleWSRPFault(Logger logger, java.rmi.RemoteException wsrpFault) throws WSRPException(Code) | | This method translates a WSRP fault into a WSRP
exception containing a corresponding error code
and logs the occurence of the exception
Parameters: logger - the logger to be used Parameters: wsrpFault - the fault to be translated exception: WSRPException - this is the translated exception |
throwX | public static void throwX(int errorCode) throws WSRPException(Code) | | Throws a new exception with a specific message
identified by an error code without logging
Parameters: errorCode - integer specifying an error message exception: WSRPException - |
throwX | public static void throwX(int errorCode, Throwable t) throws WSRPException(Code) | | Throws a new exception with a specific message
identified by an error code without logging
Parameters: errorCode - integer specifying an error message Parameters: t - the nested exception exception: WSRPException - |
throwX | public static void throwX(Logger logger, int logLevel, String method, int errorCode) throws WSRPException(Code) | | Throws a new exception with a specific message
identified by an error code and logs the exception
to a logger.
Parameters: logger - an appropriate logger Parameters: logLevel - requested logging level (ERROR,WARN,INFO,TRACE_LOW,TRACE_MEDIUM,TRACE_HIGH) Parameters: method - the method in that an Exception is thrown Parameters: errorCode - integer specifying an error message exception: WSRPException - |
throwX | public static void throwX(Logger logger, int logLevel, String method, int errorCode, Throwable t) throws WSRPException(Code) | | Throws a new exception with a specific message
identified by an error code and logs the exception
to a logger.
Parameters: logger - an appropriate logger Parameters: logLevel - requested logging level (ERROR,WARN,INFO,TRACE_LOW,TRACE_MEDIUM,TRACE_HIGH) Parameters: method - the method in that an Exception is thrown Parameters: errorCode - integer specifying an error message Parameters: t - the nested exception exception: WSRPException - |
|
|