|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wsrp4j.exception.WSRPXHelper
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
Constructor Summary | |
WSRPXHelper()
|
Method Summary | |
protected static WSRPException |
getException(int errorCode,
java.lang.Throwable t)
Returns an Exception. |
static void |
handleWSRPException(WSRPException exception)
This method translates a WSRP exception into an apropriate WSRP fault according to the error code |
static void |
handleWSRPFault(Logger logger,
java.rmi.RemoteException wsrpFault)
This method translates a WSRP fault into a WSRP exception containing a corresponding error code and logs the occurence of the exception |
static void |
throwX(int errorCode)
Throws a new exception with a specific message identified by an error code without logging |
static void |
throwX(int errorCode,
java.lang.Throwable t)
Throws a new exception with a specific message identified by an error code without logging |
static void |
throwX(Logger logger,
int logLevel,
java.lang.String method,
int errorCode)
Throws a new exception with a specific message identified by an error code and logs the exception to a logger. |
static void |
throwX(Logger logger,
int logLevel,
java.lang.String method,
int errorCode,
java.lang.Throwable t)
Throws a new exception with a specific message identified by an error code and logs the exception to a logger. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WSRPXHelper()
Method Detail |
public static void throwX(int errorCode) throws WSRPException
errorCode
- integer specifying an error message
WSRPException
public static void throwX(int errorCode, java.lang.Throwable t) throws WSRPException
errorCode
- integer specifying an error messaget
- the nested exception
WSRPException
public static void throwX(Logger logger, int logLevel, java.lang.String method, int errorCode) throws WSRPException
logger
- an appropriate loggerlogLevel
- requested logging level (ERROR,WARN,INFO,
TRACE_LOW,
TRACE_MEDIUM,
TRACE_HIGH)method
- the method in that an Exception is thrownerrorCode
- integer specifying an error message
WSRPException
public static void throwX(Logger logger, int logLevel, java.lang.String method, int errorCode, java.lang.Throwable t) throws WSRPException
logger
- an appropriate loggerlogLevel
- requested logging level (ERROR,WARN,INFO,
TRACE_LOW,
TRACE_MEDIUM,
TRACE_HIGH)method
- the method in that an Exception is thrownerrorCode
- integer specifying an error messaget
- the nested exception
WSRPException
public static void handleWSRPException(WSRPException exception) throws java.rmi.RemoteException
exception
- the WSRPException to be translated
java.rmi.RemoteException
- the translated faultpublic static void handleWSRPFault(Logger logger, java.rmi.RemoteException wsrpFault) throws WSRPException
logger
- the logger to be usedwsrpFault
- the fault to be translated
WSRPException
- this is the translated exceptionprotected static WSRPException getException(int errorCode, java.lang.Throwable t)
errorCode
- integer specifying an error message
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |