public class ManagedConnectionImpl extends Object implements ManagedConnection, ManagedConnectionMetaData
ManagedConnectionFactory
,
and then encapsulated into a Connection
which is then returned to the
application (via the ConnectionFactory
).
If sharing is allowed, several different Connection
s may be
associated to a given ManagedConnection
, although not at the same
time.
Constructor and Description |
---|
ManagedConnectionImpl(ManagedConnectionFactoryImpl managedConnectionFactory,
ConnectionRequestInfoImpl connectionRequestInfo)
Creates a new physical connection to the underlying storage.
|
Modifier and Type | Method and Description |
---|---|
void |
addConnectionEventListener(ConnectionEventListener listener)
Called by the application server to add a listener who should be notified
of all relevant events on this connection.
|
void |
associateConnection(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.
|
Connection |
getConnection(Subject subject,
ConnectionRequestInfo connectionRequestInfo)
Creates a new
Connection handle to this ManagedConnection
. |
String |
getEISProductName() |
String |
getEISProductVersion() |
LocalTransaction |
getLocalTransaction() |
PrintWriter |
getLogWriter() |
int |
getMaxConnections() |
ManagedConnectionMetaData |
getMetaData() |
String |
getUserName() |
XAResource |
getXAResource() |
void |
removeConnectionEventListener(ConnectionEventListener listener)
Called by the application server to remove a listener.
|
void |
setLogWriter(PrintWriter out) |
public ManagedConnectionImpl(ManagedConnectionFactoryImpl managedConnectionFactory, ConnectionRequestInfoImpl connectionRequestInfo) throws ResourceException
ManagedConnectionFactory
when it needs a new connection.ResourceException
public Connection getConnection(Subject subject, ConnectionRequestInfo connectionRequestInfo) throws ResourceException
Connection
handle to this ManagedConnection
.getConnection
in interface ManagedConnection
ResourceException
public void cleanup()
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.
cleanup
in interface ManagedConnection
public void destroy() throws ResourceException
Called by the application server before this ManagedConnection
is
destroyed.
destroy
in interface ManagedConnection
ResourceException
public void associateConnection(Object object) throws ResourceException
Connection
handle with a
ManagedConnection
instance.associateConnection
in interface ManagedConnection
ResourceException
public XAResource getXAResource()
getXAResource
in interface ManagedConnection
public LocalTransaction getLocalTransaction()
getLocalTransaction
in interface ManagedConnection
public void addConnectionEventListener(ConnectionEventListener listener)
addConnectionEventListener
in interface ManagedConnection
public void removeConnectionEventListener(ConnectionEventListener listener)
removeConnectionEventListener
in interface ManagedConnection
public ManagedConnectionMetaData getMetaData()
getMetaData
in interface ManagedConnection
public void setLogWriter(PrintWriter out)
setLogWriter
in interface ManagedConnection
public PrintWriter getLogWriter()
getLogWriter
in interface ManagedConnection
public String getEISProductName()
getEISProductName
in interface ManagedConnectionMetaData
public String getEISProductVersion()
getEISProductVersion
in interface ManagedConnectionMetaData
public int getMaxConnections()
getMaxConnections
in interface ManagedConnectionMetaData
public String getUserName() throws ResourceException
getUserName
in interface ManagedConnectionMetaData
ResourceException
Copyright © 2013 Nuxeo SA. All Rights Reserved.