Interface RecoverableXAResource
-
@ConsumerType public interface RecoverableXAResourceARecoverableXAResourceservice may be provided by aResourceProviderif they are able to support XA recovery operations. There are two main sorts of recovery:- Recovery after a remote failure, where the local transaction manager runs throughout
- Recovery after a local failure, where the transaction manager replays in-doubt transactions from its log
getId()provides a persistent name that can be used to correlate usage of the resource both before and after failure. This identifier must also be passed toTransactionContext.registerXAResource(XAResource, String)each time the recoverable resource is used.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringOSGI_RECOVERY_ENABLEDThis service property key is used byTransactionControlservices andResourceProviderfactories to indicate that they can support transaction recovery.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetId()Get the id of this resource.javax.transaction.xa.XAResourcegetXAResource()Get a new, valid XAResource that can be used in recovery This XAResource will be returned later using thereleaseXAResource(XAResource)methodvoidreleaseXAResource(javax.transaction.xa.XAResource xaRes)Release the XAResource that has been used for recovery
-
-
-
Field Detail
-
OSGI_RECOVERY_ENABLED
static final java.lang.String OSGI_RECOVERY_ENABLED
This service property key is used byTransactionControlservices andResourceProviderfactories to indicate that they can support transaction recovery.- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
java.lang.String getId()
Get the id of this resource. This should be unique, and persist between restarts- Returns:
- an identifier, never
null
-
getXAResource
javax.transaction.xa.XAResource getXAResource() throws java.lang.ExceptionGet a new, valid XAResource that can be used in recovery This XAResource will be returned later using thereleaseXAResource(XAResource)method- Returns:
- a valid, connected, XAResource
- Throws:
java.lang.Exception- If it is not possible to acquire a valid XAResource at the current time, for example if the database is temporarily unavailable.
-
releaseXAResource
void releaseXAResource(javax.transaction.xa.XAResource xaRes)
Release the XAResource that has been used for recovery- Parameters:
xaRes- AnXAResourcepreviously returned bygetXAResource()
-
-