XAResourceProducer (Bitronix Transaction Manager :: Core 2.1.4 API)
Date: 2013-09-15

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## bitronix.tm.resource.common
Interface XAResourceProducer

All Superinterfaces:
  Referenceable, Serializable

All Known Implementing Classes:
  EhCacheXAResourceProducer, PoolingConnectionFactory, PoolingDataSource

    public interface XAResourceProducer

extends Referenceable, Serializable

A `XAResourceProducer` is a `XAStatefulHolder` factory. It must be implemented by any class that is able to produce pooled XA connections.

Author:
  lorban

Method Summary
`void` | `close()` Release this `XAResourceProducer`'s internal resources.
`XAStatefulHolder` | `createPooledConnection(Object xaFactory, ResourceBean bean)` Create a `XAStatefulHolder` that will be placed in an `XAPool`.
`void` | `endRecovery()` Release internal resources held after call to `startRecovery()`.
`XAResourceHolder` | `findXAResourceHolder(XAResource xaResource)` Find in the `XAResourceHolder`s created by this `XAResourceProducer` the one which this `XAResource` belongs to.
`String` | `getUniqueName()` Get the resource name as registered in the transactions journal.
`void` | `init()` Initialize this `XAResourceProducer`'s internal resources.
`void` | `setFailed(boolean failed)` Mark this resource producer as failed or not.
`XAResourceHolderState` | `startRecovery()` Prepare the recoverable `XAResource` producer for recovery.

Methods inherited from interface javax.naming.Referenceable
`getReference`

Method Detail

### getUniqueName

    String getUniqueName()

  Get the resource name as registered in the transactions journal.

  Returns:
    the unique name of the resource.

### startRecovery

    XAResourceHolderState startRecovery()
                                        throws RecoveryException

  Prepare the recoverable `XAResource` producer for recovery.

  Returns:
    a `XAResourceHolderState` object that can be used to call `recover()`.
  Throws:
    `RecoveryException` - thrown when a `XAResourceHolderState` cannot be acquired.

### endRecovery

    void endRecovery()
                     throws RecoveryException

  Release internal resources held after call to `startRecovery()`.

  Throws:
    `RecoveryException` - thrown when an error occured while releasing reserved resources.

### setFailed

    void setFailed(boolean failed)

  Mark this resource producer as failed or not. A resource is considered failed if recovery fails to run on it.

  Parameters:
    `failed` - true is the resource must be considered failed, false it it must be considered sane.

### findXAResourceHolder

    XAResourceHolder findXAResourceHolder(XAResource xaResource)

  Find in the `XAResourceHolder`s created by this `XAResourceProducer` the one which this `XAResource` belongs to.

  Parameters:
    `xaResource` - the `XAResource` to look for.
  Returns:
    the associated `XAResourceHolder` or null if the `XAResource` does not belong to this `XAResourceProducer`.

### init

    void init()

  Initialize this `XAResourceProducer`'s internal resources.

### close

    void close()

  Release this `XAResourceProducer`'s internal resources.

### createPooledConnection

    XAStatefulHolder createPooledConnection(Object xaFactory,
                                            ResourceBean bean)
                                            throws Exception

  Create a `XAStatefulHolder` that will be placed in an `XAPool`.

  Parameters:
    `xaFactory` - the vendor's resource-specific XA factory.
    `bean` - the resource-specific bean describing the resource parameters.
  Returns:
    a `XAStatefulHolder` that will be placed in an `XAPool`.
  Throws:
    `Exception` - thrown when the `XAStatefulHolder` cannot be created.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006-2013 Bitronix Software. All Rights Reserved.