PoolingConnectionFactory (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.jms
Class PoolingConnectionFactory

    java.lang.Object
      bitronix.tm.resource.common.ResourceBean
          bitronix.tm.resource.jms.PoolingConnectionFactory

All Implemented Interfaces:
  XAResourceProducer, PoolingConnectionFactoryMBean, Serializable, javax.jms.ConnectionFactory, Referenceable

    public class PoolingConnectionFactory

extends ResourceBean
implements javax.jms.ConnectionFactory, XAResourceProducer, PoolingConnectionFactoryMBean

Implementation of a JMS `ConnectionFactory` wrapping vendor's `XAConnectionFactory` implementation.

Author:
  lorban
See Also:
  Serialized Form

Constructor Summary
`PoolingConnectionFactory()`

Method Summary
`void` | `close()` Release this `XAResourceProducer`'s internal resources.
`javax.jms.Connection` | `createConnection()`
`javax.jms.Connection` | `createConnection(String userName, String password)`
`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.
`boolean` | `getCacheProducersConsumers()`
`long` | `getInPoolSize()`
`String` | `getPassword()`
`Reference` | `getReference()` `PoolingConnectionFactory` must alway have a unique name so this method builds a reference to this object using the unique name as `RefAddr`.
`boolean` | `getTestConnections()`
`long` | `getTotalPoolSize()`
`String` | `getUser()`
`void` | `init()` Initialize the pool by creating the initial amount of connections.
`boolean` | `isFailed()`
`void` | `reset()`
`void` | `setCacheProducersConsumers(boolean cacheProducersConsumers)`
`void` | `setFailed(boolean failed)` Mark this resource producer as failed or not.
`void` | `setPassword(String password)`
`void` | `setTestConnections(boolean testConnections)`
`void` | `setUser(String user)`
`XAResourceHolderState` | `startRecovery()` Prepare the recoverable `XAResource` producer for recovery.
`String` | `toString()`

Methods inherited from class bitronix.tm.resource.common.ResourceBean
`getAcquireIncrement, getAcquisitionInterval, getAcquisitionTimeout, getAllowLocalTransactions, getApplyTransactionTimeout, getAutomaticEnlistingEnabled, getClassName, getDeferConnectionRelease, getDriverProperties, getIgnoreRecoveryFailures, getMaxIdleTime, getMaxPoolSize, getMinPoolSize, getShareTransactionConnections, getTwoPcOrderingPosition, getUniqueName, getUseTmJoin, incCreatedResourcesCounter, isDisabled, setAcquireIncrement, setAcquisitionInterval, setAcquisitionTimeout, setAllowLocalTransactions, setApplyTransactionTimeout, setAutomaticEnlistingEnabled, setClassName, setDeferConnectionRelease, setDisabled, setDriverProperties, setIgnoreRecoveryFailures, setMaxIdleTime, setMaxPoolSize, setMinPoolSize, setShareTransactionConnections, setTwoPcOrderingPosition, setUniqueName, setUseTmJoin`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface bitronix.tm.resource.common.XAResourceProducer
`getUniqueName`

Methods inherited from interface bitronix.tm.resource.jms.PoolingConnectionFactoryMBean
`getMaxPoolSize, getMinPoolSize, isDisabled, setDisabled`

Constructor Detail

### PoolingConnectionFactory

    public PoolingConnectionFactory()

Method Detail

### init

    public void init()

  Initialize the pool by creating the initial amount of connections.

  Specified by:
    `init` in interface `XAResourceProducer`

### getCacheProducersConsumers

    public boolean getCacheProducersConsumers()

### setCacheProducersConsumers

    public void setCacheProducersConsumers(boolean cacheProducersConsumers)

### getTestConnections

    public boolean getTestConnections()

### setTestConnections

    public void setTestConnections(boolean testConnections)

### getUser

    public String getUser()

### setUser

    public void setUser(String user)

### getPassword

    public String getPassword()

### setPassword

    public void setPassword(String password)

### createConnection

    public javax.jms.Connection createConnection()
                                          throws javax.jms.JMSException

  Specified by:
    `createConnection` in interface `javax.jms.ConnectionFactory`
  Throws:
    `javax.jms.JMSException`

### createConnection

    public javax.jms.Connection createConnection(String userName,
                                                 String password)
                                          throws javax.jms.JMSException

  Specified by:
    `createConnection` in interface `javax.jms.ConnectionFactory`
  Throws:
    `javax.jms.JMSException`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### startRecovery

    public XAResourceHolderState startRecovery()
                                        throws RecoveryException

  Description copied from interface: `XAResourceProducer`
  Prepare the recoverable `XAResource` producer for recovery.

  Specified by:
    `startRecovery` in interface `XAResourceProducer`
  Returns:
    a `XAResourceHolderState` object that can be used to call `recover()`.
  Throws:
    `RecoveryException` - thrown when a `XAResourceHolderState` cannot be acquired.

### endRecovery

    public void endRecovery()
                     throws RecoveryException

  Description copied from interface: `XAResourceProducer`
  Release internal resources held after call to `startRecovery()`.

  Specified by:
    `endRecovery` in interface `XAResourceProducer`
  Throws:
    `RecoveryException` - thrown when an error occured while releasing reserved resources.

### setFailed

    public void setFailed(boolean failed)

  Description copied from interface: `XAResourceProducer`
  Mark this resource producer as failed or not. A resource is considered failed if recovery fails to run on it.

  Specified by:
    `setFailed` in interface `XAResourceProducer`
  Parameters:
    `failed` - true is the resource must be considered failed, false it it must be considered sane.

### isFailed

    public boolean isFailed()

  Specified by:
    `isFailed` in interface `PoolingConnectionFactoryMBean`

### close

    public void close()

  Description copied from interface: `XAResourceProducer`
  Release this `XAResourceProducer`'s internal resources.

  Specified by:
    `close` in interface `XAResourceProducer`

### createPooledConnection

    public XAStatefulHolder createPooledConnection(Object xaFactory,
                                                   ResourceBean bean)
                                            throws Exception

  Description copied from interface: `XAResourceProducer`
  Create a `XAStatefulHolder` that will be placed in an `XAPool`.

  Specified by:
    `createPooledConnection` in interface `XAResourceProducer`
  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.

### findXAResourceHolder

    public XAResourceHolder findXAResourceHolder(XAResource xaResource)

  Description copied from interface: `XAResourceProducer`
  Find in the `XAResourceHolder`s created by this `XAResourceProducer` the one which this `XAResource` belongs to.

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

### getReference

    public Reference getReference()
                           throws NamingException

  `PoolingConnectionFactory` must alway have a unique name so this method builds a reference to this object using the unique name as `RefAddr`.

  Specified by:
    `getReference` in interface `Referenceable`
  Returns:
    a reference to this `PoolingConnectionFactory`.
  Throws:
    `NamingException`

### getInPoolSize

    public long getInPoolSize()

  Specified by:
    `getInPoolSize` in interface `PoolingConnectionFactoryMBean`

### getTotalPoolSize

    public long getTotalPoolSize()

  Specified by:
    `getTotalPoolSize` in interface `PoolingConnectionFactoryMBean`

### reset

    public void reset()
               throws Exception

  Specified by:
    `reset` in interface `PoolingConnectionFactoryMBean`
  Throws:
    `Exception`

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.