Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.core.storage.sql.ra
Class ManagedConnectionImpl

java.lang.Object
  extended by org.nuxeo.ecm.core.storage.sql.ra.ManagedConnectionImpl
All Implemented Interfaces:
javax.resource.spi.ManagedConnection, javax.resource.spi.ManagedConnectionMetaData

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

The managed connection represents an actual physical connection to the underlying storage. It is created by the ManagedConnectionFactory, and then encapsulated into a Connection which is then returned to the application (via the ConnectionFactory).

If sharing is allowed, several different Connections may be associated to a given ManagedConnection, although not at the same time.

Author:
Florent Guillaume

Constructor Summary
ManagedConnectionImpl(ManagedConnectionFactoryImpl managedConnectionFactory, ConnectionRequestInfoImpl connectionRequestInfo)
          Creates a new physical connection to the underlying storage.
 
Method Summary
 void addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
          Called by the application server to add a listener who should be notified of all relevant events on this connection.
 void associateConnection(java.lang.Object object)
          Called by the application server to change the association of an application-level Connection handle with a ManagedConnection instance.
 void cleanup()
          Cleans up the physical connection, so that it may be reused.
 void destroy()
          Destroys the physical connection.
 javax.resource.cci.Connection getConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo connectionRequestInfo)
          Creates a new Connection handle to this ManagedConnection .
 java.lang.String getEISProductName()
           
 java.lang.String getEISProductVersion()
           
 javax.resource.spi.LocalTransaction getLocalTransaction()
           
 java.io.PrintWriter getLogWriter()
           
 int getMaxConnections()
           
 javax.resource.spi.ManagedConnectionMetaData getMetaData()
           
 java.lang.String getUserName()
           
 javax.transaction.xa.XAResource getXAResource()
           
 void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
          Called by the application server to remove a listener.
 void setLogWriter(java.io.PrintWriter out)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedConnectionImpl

public ManagedConnectionImpl(ManagedConnectionFactoryImpl managedConnectionFactory,
                             ConnectionRequestInfoImpl connectionRequestInfo)
                      throws javax.resource.ResourceException
Creates a new physical connection to the underlying storage. Called by the ManagedConnectionFactory when it needs a new connection.

Throws:
javax.resource.ResourceException
Method Detail

getConnection

public javax.resource.cci.Connection getConnection(javax.security.auth.Subject subject,
                                                   javax.resource.spi.ConnectionRequestInfo connectionRequestInfo)
                                            throws javax.resource.ResourceException
Creates a new Connection handle to this ManagedConnection .

Specified by:
getConnection in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

cleanup

public void cleanup()
Cleans up the physical connection, so that it may be reused.

Called by the application server before putting back this ManagedConnection into the application server pool.

Later, the application server may call getConnection(javax.security.auth.Subject, javax.resource.spi.ConnectionRequestInfo) again.

Specified by:
cleanup in interface javax.resource.spi.ManagedConnection

destroy

public void destroy()
             throws javax.resource.ResourceException
Destroys the physical connection.

Called by the application server before this ManagedConnection is destroyed.

Specified by:
destroy in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

associateConnection

public void associateConnection(java.lang.Object object)
                         throws javax.resource.ResourceException
Called by the application server to change the association of an application-level Connection handle with a ManagedConnection instance.

Specified by:
associateConnection in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

getXAResource

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

getLocalTransaction

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

addConnectionEventListener

public void addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Called by the application server to add a listener who should be notified of all relevant events on this connection.

Specified by:
addConnectionEventListener in interface javax.resource.spi.ManagedConnection

removeConnectionEventListener

public void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Called by the application server to remove a listener.

Specified by:
removeConnectionEventListener in interface javax.resource.spi.ManagedConnection

getMetaData

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

setLogWriter

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

getLogWriter

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

getEISProductName

public java.lang.String getEISProductName()
Specified by:
getEISProductName in interface javax.resource.spi.ManagedConnectionMetaData

getEISProductVersion

public java.lang.String getEISProductVersion()
Specified by:
getEISProductVersion in interface javax.resource.spi.ManagedConnectionMetaData

getMaxConnections

public int getMaxConnections()
Specified by:
getMaxConnections in interface javax.resource.spi.ManagedConnectionMetaData

getUserName

public java.lang.String getUserName()
                             throws javax.resource.ResourceException
Specified by:
getUserName in interface javax.resource.spi.ManagedConnectionMetaData
Throws:
javax.resource.ResourceException

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.