Package org.apache.axis2.jaxws
Class ExceptionFactory
java.lang.Object
org.apache.axis2.jaxws.ExceptionFactory
ExceptionFactory is used to create exceptions within the JAX-WS implementation. There are several
reasons for using a factory to create exceptions. 1. We can intercept all exception creation and
add the appropriate logging/serviceability. 2. Exceptions are chained. ExceptionFactory can
lengthen or reduce the cause chains as necessary to support the JAX-WS programming model. 3.
Prevents construction of the same exception. Uses similar principles as
AxisFault.makeException.
Example Usage: // Example usage
public fooMethod() throws WebServiceException { try{ ... } catch(Exception e){ throw
ExceptionFactory.makeWebServiceException(e); } }
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic jakarta.xml.ws.ProtocolExceptionmakeProtocolException(String message, Throwable throwable) Create a ProtocolException using the information from a Throwable and messagestatic jakarta.xml.ws.WebServiceExceptionmakeWebServiceException(String message) Make a WebServiceException with a given messagestatic jakarta.xml.ws.WebServiceExceptionmakeWebServiceException(String message, Throwable throwable) Create a WebServiceException using the information from a given Throwable instance and messagestatic jakarta.xml.ws.WebServiceExceptionmakeWebServiceException(Throwable throwable) Create a WebServiceException using the information from a given Throwable instancestatic voidsetInitialCause(Throwable target, Throwable initialCause) Give a target Throwable, set the initialCause Throwable as the initial cause on the target.static StringGet a string containing the stack of the specified exception
-
Field Details
-
log
protected static org.apache.commons.logging.Log log
-
-
Method Details
-
makeWebServiceException
public static jakarta.xml.ws.WebServiceException makeWebServiceException(String message, Throwable throwable) Create a WebServiceException using the information from a given Throwable instance and message- Parameters:
message-throwable-- Returns:
- WebServiceException
-
makeProtocolException
public static jakarta.xml.ws.ProtocolException makeProtocolException(String message, Throwable throwable) Create a ProtocolException using the information from a Throwable and message- Parameters:
message-throwable-- Returns:
- ProtocolException
-
makeWebServiceException
Make a WebServiceException with a given message- Parameters:
message-- Returns:
- WebServiceException
-
makeWebServiceException
Create a WebServiceException using the information from a given Throwable instance- Parameters:
throwable-- Returns:
- WebServiceException
-
stackToString
Get a string containing the stack of the specified exception- Parameters:
e-- Returns:
-
setInitialCause
Give a target Throwable, set the initialCause Throwable as the initial cause on the target.- Parameters:
target- The throwable on which to set the initial causeinitialCause- The initial cause to set on the target Throwable.
-