Class SimpleExceptionReport
- java.lang.Object
-
- com.adaptris.core.services.exception.SimpleExceptionReport
-
- All Implemented Interfaces:
ExceptionReportGenerator
public class SimpleExceptionReport extends java.lang.Object implements ExceptionReportGenerator
ExceptionReportGenerator
implementation that inserts the entire stack trace of the exception as the configured element.Currently the only
ExceptionReportGenerator
implementation, this can be used as part of aExceptionReportService
to add the stack trace of the exception wrapped as an XML element of your choosing (as dictated bysetElementName(String)
). The data in the element itself is wrapped in a CDATA tag.In the adapter configuration file this class is aliased as simple-exception-report which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Constructor Summary
Constructors Constructor Description SimpleExceptionReport()
SimpleExceptionReport(java.lang.String elementName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.w3c.dom.Document
create(java.lang.Exception e, java.lang.String workflow, java.lang.String location)
Create a Document from the exception.java.lang.String
getElementName()
void
setElementName(java.lang.String s)
Set the element name for the stack trace.
-
-
-
Method Detail
-
create
public org.w3c.dom.Document create(java.lang.Exception e, java.lang.String workflow, java.lang.String location) throws java.lang.Exception
Description copied from interface:ExceptionReportGenerator
Create a Document from the exception.- Specified by:
create
in interfaceExceptionReportGenerator
- Parameters:
e
- the exceptionworkflow
- the workflow where it happenedlocation
- where in the workflow it happened.- Returns:
- a document ready to be merged.
- Throws:
java.lang.Exception
- on error.
-
getElementName
public java.lang.String getElementName()
-
setElementName
public void setElementName(java.lang.String s)
Set the element name for the stack trace.- Parameters:
s
- the element name, if not specified defaults toException
-
-