Package io.helidon.integrations.jta.jdbc
Interface ExceptionConverter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A functional interface whose implementations can convert a kind of
Exception
encountered in the context of an XA routine to an appropriate XAException, according
to the rules in the XA specification as
expressed in the documentation for the XAResource
interface.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumAn enum describing XA routines modeled by anXAResourceimplementation. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcodeToString(int code) Returns a non-nullStringrepresentation of the supplied code.convert(ExceptionConverter.XARoutine xaRoutine, Exception exception) Converts the suppliedExceptionencountered in the context of the suppliedExceptionConverter.XARoutineto anXAExceptionwith an appropriate error code, idiomatically following the rules of the XA specification.
-
Method Details
-
convert
Converts the suppliedExceptionencountered in the context of the suppliedExceptionConverter.XARoutineto anXAExceptionwith an appropriate error code, idiomatically following the rules of the XA specification.- Parameters:
xaRoutine- theExceptionConverter.XARoutine; must not benullexception- theExceptionto convert; most commonly a variety ofSQLExceptionorRuntimeException; if supplied with anXAExceptionthisExceptionConvertermust simply return it; if supplied withnulla newXAExceptionwith a general-purpose error codemust be returned- Returns:
- a suitable non-
nullXAException - Throws:
NullPointerException- ifroutineisnull- See Also:
-
codeToString
Returns a non-nullStringrepresentation of the supplied code.The format of the returned
Stringis left deliberately undefined and may change between versions of this interface without prior notice.- Parameters:
code- a code; usually the value of astaticfield in theXAExceptionclass- Returns:
- a non-
nullStringrepresentation of the supplied code
-