org.apache.derby.jdbc
Class EmbedXAConnection40

java.lang.Object
  extended by org.apache.derby.jdbc.EmbedPooledConnection
      extended by org.apache.derby.jdbc.EmbedXAConnection
          extended by org.apache.derby.jdbc.EmbedXAConnection40
All Implemented Interfaces:
javax.sql.PooledConnection, javax.sql.XAConnection, BrokeredConnectionControl

final class EmbedXAConnection40
extends EmbedXAConnection
implements javax.sql.XAConnection

This class implements jdbc4.0 methods 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.jdbc.EmbedPooledConnection
currentConnectionHandle, dataSource, defaultIsolationLevel, isActive, realConnection
 
Constructor Summary
EmbedXAConnection40(EmbeddedDataSource ds, ResourceAdapter ra, java.lang.String user, java.lang.String password, boolean requestPassword)
          Creates EmbedXAConnection40.
 
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.jdbc.EmbedXAConnection
checkAutoCommit, checkClose, checkCommit, checkHoldCursors, checkRollback, checkSavepoint, getConnection, getRealConnection, getXAResource, isInGlobalTransaction, wrapStatement, wrapStatement, wrapStatement
 
Methods inherited from class org.apache.derby.jdbc.EmbedPooledConnection
addConnectionEventListener, checkActive, close, closingConnection, getLanguageConnection, getNewCurrentConnectionHandle, getPassword, getUsername, isIsolationLevelSetUsingSQLorJDBC, notifyError, notifyException, openRealConnection, removeConnectionEventListener, resetIsolationLevelFlag, resetRealConnection, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sql.XAConnection
getXAResource
 
Methods inherited from interface javax.sql.PooledConnection
addConnectionEventListener, close, getConnection, 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

EmbedXAConnection40

EmbedXAConnection40(EmbeddedDataSource ds,
                    ResourceAdapter ra,
                    java.lang.String user,
                    java.lang.String password,
                    boolean requestPassword)
              throws java.sql.SQLException
Creates EmbedXAConnection40.

Parameters:
ds -
ra -
user -
password -
requestPassword -
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.

Specified by:
removeStatementEventListener in interface javax.sql.PooledConnection
Parameters:
listener - the component which implements the StatementEventListener interface that was previously registered with this PooledConnection object

Since:
1.6

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.

Specified by:
addStatementEventListener in interface javax.sql.PooledConnection
Parameters:
listener - an component which implements the StatementEventListener interface that is to be registered with this PooledConnection object

Since:
1.6

onStatementClose

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

Specified by:
onStatementClose in interface BrokeredConnectionControl
Overrides:
onStatementClose in class EmbedPooledConnection
Parameters:
statement - PreparedStatement

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

Specified by:
onStatementErrorOccurred in interface BrokeredConnectionControl
Overrides:
onStatementErrorOccurred in class EmbedPooledConnection
Parameters:
statement - PreparedStatement
sqle - SQLException

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

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