org.apache.derby.client
Class ClientXAConnection40

java.lang.Object
  extended by org.apache.derby.client.ClientPooledConnection
      extended by org.apache.derby.client.ClientXAConnection
          extended by org.apache.derby.client.ClientXAConnection40
All Implemented Interfaces:
javax.sql.PooledConnection, javax.sql.XAConnection

public class ClientXAConnection40
extends ClientXAConnection

jdbc4.0 implementation of XAConnection


Field Summary
private  java.util.concurrent.CopyOnWriteArrayList<javax.sql.StatementEventListener> statementEventListeners
          List of statement event listeners.
 
Fields inherited from class org.apache.derby.client.ClientPooledConnection
logicalConnection_, logWriter_, netPhysicalConnection_, netXAPhysicalConnection_, physicalConnection_, rmId_
 
Constructor Summary
ClientXAConnection40(ClientXADataSource ds, NetLogWriter logWtr, java.lang.String userId, java.lang.String password)
          Constructor for ClientXAConnection40.
 
Method Summary
 void addStatementEventListener(javax.sql.StatementEventListener listener)
          Registers a StatementEventListener with this PooledConnection object.
 void onStatementClose(java.sql.PreparedStatement statement)
          Raise the statementClosed event for all the listeners when the corresponding events occurs
 void onStatementErrorOccurred(java.sql.PreparedStatement statement, java.sql.SQLException sqle)
          Raise the statementErrorOccurred event for all the listeners when the corresponding events occurs.
 void removeStatementEventListener(javax.sql.StatementEventListener listener)
          Removes the specified StatementEventListener from the list of components that will be notified when the driver detects that a PreparedStatement has been closed or is invalid.
 
Methods inherited from class org.apache.derby.client.ClientXAConnection
close, createControlConnection, getConnection, getDataSource, getRmId, getXAResource
 
Methods inherited from class org.apache.derby.client.ClientPooledConnection
addConnectionEventListener, finalize, getNetXAConnection, informListeners, isStatementPoolingEnabled, nullLogicalConnection, recycleConnection, removeConnectionEventListener
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sql.PooledConnection
addConnectionEventListener, removeConnectionEventListener
 

Field Detail

statementEventListeners

private final java.util.concurrent.CopyOnWriteArrayList<javax.sql.StatementEventListener> statementEventListeners
List of statement event listeners. The list is copied on each write, ensuring that it can be safely iterated over even if other threads or the listeners fired in the same thread add or remove listeners.

Constructor Detail

ClientXAConnection40

public ClientXAConnection40(ClientXADataSource ds,
                            NetLogWriter logWtr,
                            java.lang.String userId,
                            java.lang.String password)
                     throws java.sql.SQLException
Constructor for ClientXAConnection40.

Parameters:
ds -
logWtr -
userId -
password -
Throws:
java.sql.SQLException
Method Detail

removeStatementEventListener

public void removeStatementEventListener(javax.sql.StatementEventListener listener)
Removes the specified StatementEventListener from the list of components that will be notified when the driver detects that a PreparedStatement has been closed or is invalid.

Parameters:
listener - the component which implements the StatementEventListener interface that was previously registered with this PooledConnection object


addStatementEventListener

public void addStatementEventListener(javax.sql.StatementEventListener listener)
Registers a StatementEventListener with this PooledConnection object. Components that wish to be notified when PreparedStatements created by the connection are closed or are detected to be invalid may use this method to register a StatementEventListener with this PooledConnection object.

Parameters:
listener - an component which implements the StatementEventListener interface that is to be registered with this PooledConnection object


onStatementClose

public void onStatementClose(java.sql.PreparedStatement statement)
Raise the statementClosed event for all the listeners when the corresponding events occurs

Overrides:
onStatementClose in class ClientPooledConnection
Parameters:
statement - The PreparedStatement that was closed

onStatementErrorOccurred

public void onStatementErrorOccurred(java.sql.PreparedStatement statement,
                                     java.sql.SQLException sqle)
Raise the statementErrorOccurred event for all the listeners when the corresponding events occurs.

Overrides:
onStatementErrorOccurred in class ClientPooledConnection
Parameters:
statement - The PreparedStatement on which error occurred
sqle - The SQLException associated with the error that caused the invalidation of the PreparedStatements

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.