org.sourceforge.bdbadapter.cci
Class ManagedConnectionImpl

java.lang.Object
  |
  +--org.sourceforge.bdbadapter.cci.ManagedConnectionImpl
All Implemented Interfaces:
javax.resource.spi.ManagedConnection

public class ManagedConnectionImpl
extends java.lang.Object
implements javax.resource.spi.ManagedConnection


Field Summary
private  java.util.Set connections
           
private  com.sleepycat.db.Db db
           
private  boolean destroyed
           
private  AdapterEnv env
           
private  ConnectionRequestInfoImpl info
           
private  java.util.Vector listeners
           
private  java.io.PrintWriter logWriter
           
private  ManagedConnectionFactoryImpl mcf
           
private  java.util.Properties props
           
private  SpiLocalTransactionImpl spiTxn
           
 
Constructor Summary
(package private) ManagedConnectionImpl(AdapterEnv env, com.sleepycat.db.Db db, ManagedConnectionFactoryImpl mcf, java.util.Properties props, ConnectionRequestInfoImpl info)
           
 
Method Summary
(package private)  void addConnection(ConnectionImpl con)
           
 void addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
           
 void associateConnection(java.lang.Object connection)
           
private  void checkIfDestroyed()
           
 void cleanup()
           
private  void closeDb()
           
(package private)  void connectionClosed(java.lang.Exception ex, ConnectionImpl con)
           
(package private)  void connectionErrorOccurred(java.lang.Exception ex, ConnectionImpl con)
           
 void destroy()
           
 java.lang.Object getConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo info)
           
(package private)  java.util.Set getConnections()
           
(package private)  java.lang.String getDatabasePath()
           
(package private)  com.sleepycat.db.Db getDb()
           
(package private)  ConnectionRequestInfoImpl getInfo()
           
 javax.resource.spi.LocalTransaction getLocalTransaction()
           
 java.io.PrintWriter getLogWriter()
           
(package private)  ManagedConnectionFactoryImpl getMcf()
           
 javax.resource.spi.ManagedConnectionMetaData getMetaData()
           
(package private)  java.util.Properties getProperties()
           
(package private)  com.sleepycat.db.DbTxn getTxn()
           
 javax.transaction.xa.XAResource getXAResource()
           
(package private)  boolean isDestroyed()
           
(package private)  void removeConnection(ConnectionImpl con)
           
 void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
           
private  void removeUnusedLogs()
           
 void setLogWriter(java.io.PrintWriter out)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

logWriter

private java.io.PrintWriter logWriter

listeners

private java.util.Vector listeners

connections

private java.util.Set connections

mcf

private ManagedConnectionFactoryImpl mcf

destroyed

private boolean destroyed

env

private AdapterEnv env

db

private com.sleepycat.db.Db db

info

private ConnectionRequestInfoImpl info

props

private java.util.Properties props

spiTxn

private SpiLocalTransactionImpl spiTxn
Constructor Detail

ManagedConnectionImpl

ManagedConnectionImpl(AdapterEnv env,
                      com.sleepycat.db.Db db,
                      ManagedConnectionFactoryImpl mcf,
                      java.util.Properties props,
                      ConnectionRequestInfoImpl info)
                throws javax.resource.ResourceException
Method Detail

addConnectionEventListener

public void addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Specified by:
addConnectionEventListener in interface javax.resource.spi.ManagedConnection

removeConnectionEventListener

public void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Specified by:
removeConnectionEventListener in interface javax.resource.spi.ManagedConnection

getConnection

public java.lang.Object getConnection(javax.security.auth.Subject subject,
                                      javax.resource.spi.ConnectionRequestInfo info)
                               throws javax.resource.ResourceException
Specified by:
getConnection in interface javax.resource.spi.ManagedConnection

cleanup

public void cleanup()
             throws javax.resource.ResourceException
Specified by:
cleanup in interface javax.resource.spi.ManagedConnection

destroy

public void destroy()
             throws javax.resource.ResourceException
Specified by:
destroy in interface javax.resource.spi.ManagedConnection

associateConnection

public void associateConnection(java.lang.Object connection)
                         throws javax.resource.ResourceException
Specified by:
associateConnection in interface javax.resource.spi.ManagedConnection

getXAResource

public javax.transaction.xa.XAResource getXAResource()
                                              throws javax.resource.ResourceException
Specified by:
getXAResource in interface javax.resource.spi.ManagedConnection

getLocalTransaction

public javax.resource.spi.LocalTransaction getLocalTransaction()
                                                        throws javax.resource.ResourceException
Specified by:
getLocalTransaction in interface javax.resource.spi.ManagedConnection

getTxn

com.sleepycat.db.DbTxn getTxn()

getMetaData

public javax.resource.spi.ManagedConnectionMetaData getMetaData()
                                                         throws javax.resource.ResourceException
Specified by:
getMetaData in interface javax.resource.spi.ManagedConnection

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
                  throws javax.resource.ResourceException
Specified by:
setLogWriter in interface javax.resource.spi.ManagedConnection

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws javax.resource.ResourceException
Specified by:
getLogWriter in interface javax.resource.spi.ManagedConnection

getProperties

java.util.Properties getProperties()
                             throws javax.resource.ResourceException

isDestroyed

boolean isDestroyed()

checkIfDestroyed

private void checkIfDestroyed()
                       throws javax.resource.ResourceException

getMcf

ManagedConnectionFactoryImpl getMcf()

getDb

com.sleepycat.db.Db getDb()
                    throws javax.resource.ResourceException

closeDb

private void closeDb()
              throws javax.resource.ResourceException

getDatabasePath

java.lang.String getDatabasePath()

getInfo

ConnectionRequestInfoImpl getInfo()

removeConnection

void removeConnection(ConnectionImpl con)

addConnection

void addConnection(ConnectionImpl con)

getConnections

java.util.Set getConnections()

connectionClosed

void connectionClosed(java.lang.Exception ex,
                      ConnectionImpl con)
                throws java.sql.SQLException

connectionErrorOccurred

void connectionErrorOccurred(java.lang.Exception ex,
                             ConnectionImpl con)

removeUnusedLogs

private void removeUnusedLogs()