public class ManagedConnectionImpl extends Object implements javax.resource.spi.ManagedConnection, javax.resource.spi.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)
Creates a new physical connection to the underlying storage.
|
Modifier and Type | Method and Description |
---|---|
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(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.
|
protected void |
close(ConnectionImpl connection)
Called by
ConnectionImpl.close() when the connection is closed. |
void |
destroy()
Destroys the physical connection.
|
javax.resource.cci.Connection |
getConnection(Subject subject,
javax.resource.spi.ConnectionRequestInfo connectionRequestInfo)
Creates a new
Connection handle to this ManagedConnection . |
String |
getEISProductName() |
String |
getEISProductVersion() |
javax.resource.spi.LocalTransaction |
getLocalTransaction() |
PrintWriter |
getLogWriter() |
protected ManagedConnectionFactoryImpl |
getManagedConnectionFactory()
|
int |
getMaxConnections() |
javax.resource.spi.ManagedConnectionMetaData |
getMetaData() |
String |
getUserName() |
XAResource |
getXAResource() |
void |
removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Called by the application server to remove a listener.
|
protected void |
sendErrorEvent(ConnectionImpl connection,
Exception cause) |
protected void |
sendTxCommittedEvent(ConnectionImpl connection) |
protected void |
sendTxRolledbackEvent(ConnectionImpl connection) |
protected void |
sendTxStartedEvent(ConnectionImpl connection) |
void |
setLogWriter(PrintWriter out) |
public ManagedConnectionImpl(ManagedConnectionFactoryImpl managedConnectionFactory) throws javax.resource.ResourceException
ManagedConnectionFactory
when
it needs a new connection.javax.resource.ResourceException
public javax.resource.cci.Connection getConnection(Subject subject, javax.resource.spi.ConnectionRequestInfo connectionRequestInfo) throws javax.resource.ResourceException
Connection
handle to this ManagedConnection
.getConnection
in interface javax.resource.spi.ManagedConnection
javax.resource.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 javax.resource.spi.ManagedConnection
public void destroy() throws javax.resource.ResourceException
Called by the application server before this ManagedConnection
is destroyed.
destroy
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
public void associateConnection(Object object) throws javax.resource.ResourceException
Connection
handle with
a ManagedConnection
instance.associateConnection
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
public XAResource getXAResource()
getXAResource
in interface javax.resource.spi.ManagedConnection
public javax.resource.spi.LocalTransaction getLocalTransaction()
getLocalTransaction
in interface javax.resource.spi.ManagedConnection
public void addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
addConnectionEventListener
in interface javax.resource.spi.ManagedConnection
public void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
removeConnectionEventListener
in interface javax.resource.spi.ManagedConnection
public javax.resource.spi.ManagedConnectionMetaData getMetaData()
getMetaData
in interface javax.resource.spi.ManagedConnection
public void setLogWriter(PrintWriter out)
setLogWriter
in interface javax.resource.spi.ManagedConnection
public PrintWriter getLogWriter()
getLogWriter
in interface javax.resource.spi.ManagedConnection
public String getEISProductName()
getEISProductName
in interface javax.resource.spi.ManagedConnectionMetaData
public String getEISProductVersion()
getEISProductVersion
in interface javax.resource.spi.ManagedConnectionMetaData
public int getMaxConnections()
getMaxConnections
in interface javax.resource.spi.ManagedConnectionMetaData
public String getUserName() throws javax.resource.ResourceException
getUserName
in interface javax.resource.spi.ManagedConnectionMetaData
javax.resource.ResourceException
protected void close(ConnectionImpl connection)
ConnectionImpl.close()
when the connection is closed.protected ManagedConnectionFactoryImpl getManagedConnectionFactory()
protected void sendTxStartedEvent(ConnectionImpl connection)
protected void sendTxCommittedEvent(ConnectionImpl connection)
protected void sendTxRolledbackEvent(ConnectionImpl connection)
protected void sendErrorEvent(ConnectionImpl connection, Exception cause)
Copyright © 2017 Nuxeo. All rights reserved.