Class PossibleExceptionFromMetadata
- java.lang.Object
-
- com.adaptris.core.services.exception.ExceptionFromMetadataImpl
-
- com.adaptris.core.services.exception.PossibleExceptionFromMetadata
-
- All Implemented Interfaces:
ExceptionGenerator
public class PossibleExceptionFromMetadata extends ExceptionFromMetadataImpl
ExceptionGenerator
implementation that generates the exception from metadata.Use this class with
ThrowExceptionService
to throw an exception as part of a workflow. The exception message (i.e.Throwable.getMessage()
) is derived from the configured metadata key. If the metadata key does not exist (or returns no value) then no exception will be thrown. This behaviour differs fromExceptionFromMetadata
In the adapter configuration file this class is aliased as possible-exception-from-metadata which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Constructor Summary
Constructors Constructor Description PossibleExceptionFromMetadata()
PossibleExceptionFromMetadata(java.lang.String metadataKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServiceException
create(AdaptrisMessage msg)
Generate a service exception from the AdaptrisMessage.-
Methods inherited from class com.adaptris.core.services.exception.ExceptionFromMetadataImpl
getExceptionMessageMetadataKey, setExceptionMessageMetadataKey
-
-
-
-
Method Detail
-
create
public ServiceException create(AdaptrisMessage msg)
Description copied from interface:ExceptionGenerator
Generate a service exception from the AdaptrisMessage.- Parameters:
msg
- the message- Returns:
- a ServiceException ready to be thrown, or null if no exception is appropriate
-
-