org.jboss.jca.core.connectionmanager.listener

## Class TxConnectionListener

- java.lang.Object
- - org.jboss.jca.core.connectionmanager.listener.AbstractConnectionListener
  - - org.jboss.jca.core.connectionmanager.listener.TxConnectionListener

- All Implemented Interfaces:
    java.lang.Comparable, java.util.EventListener, javax.resource.spi.ConnectionEventListener, org.jboss.jca.core.api.connectionmanager.listener.ConnectionListener, org.jboss.jca.core.spi.transaction.ConnectableResourceListener

      public class TxConnectionListener
      extends AbstractConnectionListener

  Tx connection listener.
  Author:
    Gurkan Erdogdu, Jesper Pedersen

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `TxConnectionListener.TransactionSynchronization` Transaction sync. class.

  - ### Field Summary

    - ### Fields inherited from class org.jboss.jca.core.connectionmanager.listener.AbstractConnectionListener

      `connectionHandles, connectionTraces, tracking`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TxConnectionListener(ConnectionManager cm, javax.resource.spi.ManagedConnection mc, Pool pool, ManagedConnectionPool mcp, org.jboss.jca.common.api.metadata.common.FlushStrategy flushStrategy, java.lang.Boolean tracking, java.lang.Boolean enlistmentTrace, javax.transaction.xa.XAResource xaResource, int xaResourceTimeout)` Creates a new tx listener.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `connectionClosed(javax.resource.spi.ConnectionEvent ce)`
    `boolean` | `delist()` Delist the managed connection
    `void` | `dissociate()` Dissociate the connection listener
    `void` | `enlist()` Enlist the managed connection
    `protected CoreLogger` | `getLogger()` Get the logger
    `protected javax.transaction.xa.XAResource` | `getXAResource()` Get XA resource.
    `boolean` | `isManagedConnectionFree()` Is the managed connection free?
    `void` | `localTransactionCommitted(javax.resource.spi.ConnectionEvent ce)`
    `void` | `localTransactionRolledback(javax.resource.spi.ConnectionEvent ce)`
    `void` | `localTransactionStarted(javax.resource.spi.ConnectionEvent ce)`
    `void` | `tidyup()` Tidyup Invoked just before returning the connection to the pool when the connection is not being destroyed.
    `void` | `toPool()` Mark the connection as in pool
    `protected void` | `toString(java.lang.StringBuffer buffer)` Add specific properties.

    - ### Methods inherited from class org.jboss.jca.core.connectionmanager.listener.AbstractConnectionListener

      `compareTo, connectionErrorOccurred, controls, destroy, getCachedConnectionManager, getConnectionManager, getException, getLastCheckedOutTime, getLastReturnedTime, getLastValidatedTime, getManagedConnection, getManagedConnectionPool, getNumberOfConnections, getPool, getState, handleClosed, handleCreated, isEnlisted, isTimedOut, isTrackByTx, registerConnection, setLastCheckedOutTime, setLastValidatedTime, setState, setTrackByTx, supportsLazyAssociation, supportsLazyEnlistment, toString, unregisterConnection, unregisterConnections`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### TxConnectionListener

          public TxConnectionListener(ConnectionManager cm,
                                      javax.resource.spi.ManagedConnection mc,
                                      Pool pool,
                                      ManagedConnectionPool mcp,
                                      org.jboss.jca.common.api.metadata.common.FlushStrategy flushStrategy,
                                      java.lang.Boolean tracking,
                                      java.lang.Boolean enlistmentTrace,
                                      javax.transaction.xa.XAResource xaResource,
                                      int xaResourceTimeout)
                               throws javax.resource.ResourceException

      Creates a new tx listener.
      Parameters:
        `cm` - connection manager
        `mc` - managed connection
        `pool` - pool
        `mcp` - mcp
        `flushStrategy` - flushStrategy
        `tracking` - tracking
        `enlistmentTrace` - enlistmentTrace
        `xaResource` - xaresource instance
        `xaResourceTimeout` - timeout for the XAResource
      Throws:
        `javax.resource.ResourceException` - if aexception while creating

  - ### Method Detail

    - #### getLogger

          protected CoreLogger getLogger()

      Get the logger
      Specified by:
        `getLogger` in class `AbstractConnectionListener`
      Returns:
        The value

    - #### toPool

          public void toPool()

      Mark the connection as in pool
      Overrides:
        `toPool` in class `AbstractConnectionListener`

    - #### enlist

          public void enlist()
                      throws javax.transaction.SystemException

      Enlist the managed connection
      Overrides:
        `enlist` in class `AbstractConnectionListener`
      Throws:
        `javax.transaction.SystemException` - for errors

    - #### delist

          public boolean delist()
                         throws javax.resource.ResourceException

      Delist the managed connection
      Overrides:
        `delist` in class `AbstractConnectionListener`
      Returns:
        `True` if the listener was delisted succesfully, otherwise `false`
      Throws:
        `javax.resource.ResourceException` - if exception occurs

    - #### dissociate

          public void dissociate()
                          throws javax.resource.ResourceException

      Dissociate the connection listener
      Overrides:
        `dissociate` in class `AbstractConnectionListener`
      Throws:
        `javax.resource.ResourceException` - if exception occurs

    - #### getXAResource

          protected javax.transaction.xa.XAResource getXAResource()

      Get XA resource.
      Returns:
        xa resource

    - #### connectionClosed

          public void connectionClosed(javax.resource.spi.ConnectionEvent ce)

      Specified by:
        `connectionClosed` in interface `javax.resource.spi.ConnectionEventListener`
      Overrides:
        `connectionClosed` in class `AbstractConnectionListener`

    - #### localTransactionStarted

          public void localTransactionStarted(javax.resource.spi.ConnectionEvent ce)

      Specified by:
        `localTransactionStarted` in interface `javax.resource.spi.ConnectionEventListener`
      Overrides:
        `localTransactionStarted` in class `AbstractConnectionListener`

    - #### localTransactionCommitted

          public void localTransactionCommitted(javax.resource.spi.ConnectionEvent ce)

      Specified by:
        `localTransactionCommitted` in interface `javax.resource.spi.ConnectionEventListener`
      Overrides:
        `localTransactionCommitted` in class `AbstractConnectionListener`

    - #### localTransactionRolledback

          public void localTransactionRolledback(javax.resource.spi.ConnectionEvent ce)

      Specified by:
        `localTransactionRolledback` in interface `javax.resource.spi.ConnectionEventListener`
      Overrides:
        `localTransactionRolledback` in class `AbstractConnectionListener`

    - #### tidyup

          public void tidyup()
                      throws javax.resource.ResourceException

      Tidyup

      Invoked just before returning the connection to the pool when the connection is not being destroyed.

      Overrides:
        `tidyup` in class `AbstractConnectionListener`
      Throws:
        `javax.resource.ResourceException` - for any error

    - #### isManagedConnectionFree

          public boolean isManagedConnectionFree()

      Is the managed connection free?
      Overrides:
        `isManagedConnectionFree` in class `AbstractConnectionListener`
      Returns:
        true when it is free

    - #### toString

          protected void toString(java.lang.StringBuffer buffer)

      Add specific properties.
      Overrides:
        `toString` in class `AbstractConnectionListener`
      Parameters:
        `buffer` - buffer instance

Copyright © 2014 IronJacamar (http://www.ironjacamar.org)