org.jboss.jca.core.connectionmanager.listener
Class TxConnectionListener

java.lang.Object
  extended by org.jboss.jca.core.connectionmanager.listener.AbstractConnectionListener
      extended by org.jboss.jca.core.connectionmanager.listener.TxConnectionListener
All Implemented Interfaces:
Comparable, 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
 class TxConnectionListener.TransactionSynchronization
          Transaction sync.
 
Field Summary
 
Fields inherited from class org.jboss.jca.core.connectionmanager.listener.AbstractConnectionListener
trace
 
Constructor Summary
TxConnectionListener(ConnectionManager cm, javax.resource.spi.ManagedConnection mc, Pool pool, Object context, org.jboss.jca.common.api.metadata.common.FlushStrategy flushStrategy, XAResource xaResource, int xaResourceTimeout)
          Creates a new tx listener.
 
Method Summary
 void connectionClosed(javax.resource.spi.ConnectionEvent ce)
          
 void connectionErrorOccurred(javax.resource.spi.ConnectionEvent ce)
          
 void delist()
          Delist the managed connection
 void enlist()
          Enlist the managed connection
protected  CoreLogger getLogger()
          Get the logger
protected  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
protected  void toString(StringBuffer buffer)
          Add specific properties.
 void used()
          Mark the connection as used
 
Methods inherited from class org.jboss.jca.core.connectionmanager.listener.AbstractConnectionListener
compareTo, getCachedConnectionManager, getConnectionManager, getContext, getLastValidatedTime, getManagedConnection, getPool, getState, handleClosed, handleCreated, isTimedOut, isTrackByTx, registerConnection, setLastValidatedTime, setState, setTrackByTx, 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,
                            Object context,
                            org.jboss.jca.common.api.metadata.common.FlushStrategy flushStrategy,
                            XAResource xaResource,
                            int xaResourceTimeout)
                     throws javax.resource.ResourceException
Creates a new tx listener.

Parameters:
cm - connection manager
mc - managed connection
pool - pool
context - context
flushStrategy - flushStrategy
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

used

public void used()
Mark the connection as used

Overrides:
used in class AbstractConnectionListener

enlist

public void enlist()
            throws SystemException
Enlist the managed connection

Overrides:
enlist in class AbstractConnectionListener
Throws:
SystemException - for errors

delist

public void delist()
            throws javax.resource.ResourceException
Delist the managed connection

Overrides:
delist in class AbstractConnectionListener
Throws:
javax.resource.ResourceException - if exception occurs

getXAResource

protected 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

connectionErrorOccurred

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

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

isManagedConnectionFree

public boolean isManagedConnectionFree()
Is the managed connection free?

Overrides:
isManagedConnectionFree in class AbstractConnectionListener
Returns:
true when it is free

toString

protected void toString(StringBuffer buffer)
Add specific properties.

Overrides:
toString in class AbstractConnectionListener
Parameters:
buffer - buffer instance


Copyright © 2012 JBoss, by Red Hat (http://www.jboss.org/ironjacamar)