Top Description Fields Methods
org.osgi.service.transaction.control.recovery

public Interface RecoverableXAResource

Annotations
@ConsumerType
Imports
javax.transaction.xa.XAResource, org.osgi.annotation.versioning.ConsumerType, org.osgi.service.transaction.control.ResourceProvider, .TransactionContext, .TransactionControl

A RecoverableXAResource service may be provided by a ResourceProvider if they are able to support XA recovery operations. There are two main sorts of recovery: This service is used in both of these cases. The identifier returned by 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 to TransactionContext#registerXAResource(XAResource, String) each time the recoverable resource is used.

Field Summary

Modifier and TypeField and Description
public static final String
OSGI_RECOVERY_ENABLED

This service property key is used by TransactionControl services and ResourceProvider factories to indicate that they can support transaction recovery.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

an identifier, never null
getId
()

Get the id of this resource.

public javax.transaction.xa.XAResource

Returns:

a valid, connected, XAResource
getXAResource
()

Get a new, valid XAResource that can be used in recovery This XAResource will be returned later using the releaseXAResource(XAResource) method

public void
releaseXAResource(javax.transaction.xa.XAResource
An XAResource previously returned by getXAResource()
xaRes
)

Release the XAResource that has been used for recovery

Field Detail

OSGI_RECOVERY_ENABLEDback to summary
public static final String OSGI_RECOVERY_ENABLED

This service property key is used by TransactionControl services and ResourceProvider factories to indicate that they can support transaction recovery.

Method Detail

getIdback to summary
public String getId()

Get the id of this resource. This should be unique, and persist between restarts

Returns:String

an identifier, never null

getXAResourceback to summary
public javax.transaction.xa.XAResource getXAResource() throws Exception

Get a new, valid XAResource that can be used in recovery This XAResource will be returned later using the releaseXAResource(XAResource) method

Returns:javax.transaction.xa.XAResource

a valid, connected, XAResource

Exceptions
Exception:
If it is not possible to acquire a valid XAResource at the current time, for example if the database is temporarily unavailable.
releaseXAResourceback to summary
public void releaseXAResource(javax.transaction.xa.XAResource xaRes)

Release the XAResource that has been used for recovery

Parameters
xaRes:javax.transaction.xa.XAResource

An XAResource previously returned by getXAResource()