public class LogicalConnectionImpl extends Object implements LogicalConnectionImplementor
LogicalConnection implementation
IMPL NOTE : Custom serialization handling!| Constructor and Description |
|---|
LogicalConnectionImpl(Connection userSuppliedConnection,
ConnectionReleaseMode connectionReleaseMode,
JdbcServices jdbcServices,
JdbcConnectionAccess jdbcConnectionAccess) |
| Modifier and Type | Method and Description |
|---|---|
void |
addObserver(ConnectionObserver observer)
Add an observer interested in notification of connection events.
|
void |
afterStatementExecution()
Used to signify that a statement has completed execution which may
indicate that this logical connection need to perform an
aggressive release of its physical connection.
|
void |
afterTransaction()
Used to signify that a transaction has completed which may indicate
that this logical connection need to perform an aggressive release
of its physical connection.
|
void |
aggressiveRelease()
Force aggressive release of the underlying connection.
|
Connection |
close()
Release the underlying connection and clean up any other resources associated
with this logical connection.
|
static LogicalConnectionImpl |
deserialize(ObjectInputStream ois,
TransactionContext transactionContext) |
void |
disableReleases()
Manually (and temporarily) circumvent aggressive release processing.
|
void |
enableReleases()
Re-enable aggressive release processing (after a prior
LogicalConnectionImplementor.disableReleases() call. |
Connection |
getConnection()
Retrieves the connection currently "logically" managed by this LogicalConnectionImpl.
|
ConnectionReleaseMode |
getConnectionReleaseMode()
The release mode under which this logical connection is operating.
|
Connection |
getDistinctConnectionProxy()
Retrieves a distinct connection proxy.
|
JdbcServices |
getJdbcServices()
Obtains the JDBC services associated with this logical connection.
|
JdbcResourceRegistry |
getResourceRegistry()
Obtains the JDBC resource registry associated with this logical connection.
|
Connection |
getShareableConnectionProxy()
Retrieves the shareable connection proxy.
|
boolean |
isAutoCommit() |
boolean |
isOpen()
Is this logical connection open? Another phraseology sometimes used is: "are we
logically connected"?
|
boolean |
isPhysicallyConnected()
Is this logical connection instance "physically" connected.
|
boolean |
isReadyForSerialization() |
Connection |
manualDisconnect()
Manually disconnect the underlying JDBC Connection.
|
void |
manualReconnect(Connection suppliedConnection)
Manually reconnect the underlying JDBC Connection.
|
void |
notifyObserversStatementPrepared() |
void |
removeObserver(ConnectionObserver connectionObserver)
Remove an observer
|
void |
serialize(ObjectOutputStream oos) |
public LogicalConnectionImpl(Connection userSuppliedConnection, ConnectionReleaseMode connectionReleaseMode, JdbcServices jdbcServices, JdbcConnectionAccess jdbcConnectionAccess)
public JdbcServices getJdbcServices()
LogicalConnectionImplementorgetJdbcServices in interface LogicalConnectionImplementorpublic JdbcResourceRegistry getResourceRegistry()
LogicalConnectionImplementorgetResourceRegistry in interface LogicalConnectionImplementorpublic void addObserver(ConnectionObserver observer)
LogicalConnectionImplementoraddObserver in interface LogicalConnectionImplementorobserver - The observer.public void removeObserver(ConnectionObserver connectionObserver)
LogicalConnectionImplementorremoveObserver in interface LogicalConnectionImplementorconnectionObserver - The observer to remove.public boolean isOpen()
LogicalConnectionisOpen in interface LogicalConnectionpublic boolean isPhysicallyConnected()
LogicalConnectionisPhysicallyConnected in interface LogicalConnectionpublic Connection getConnection() throws HibernateException
LogicalConnectiongetConnection in interface LogicalConnectionHibernateExceptionpublic Connection getShareableConnectionProxy()
LogicalConnectiongetShareableConnectionProxy in interface LogicalConnectionpublic Connection getDistinctConnectionProxy()
LogicalConnectiongetDistinctConnectionProxy in interface LogicalConnectionpublic Connection close()
LogicalConnectionclose in interface LogicalConnectionnull if Hibernate was managing connection.public ConnectionReleaseMode getConnectionReleaseMode()
LogicalConnectionImplementorgetConnectionReleaseMode in interface LogicalConnectionImplementorpublic void afterStatementExecution()
LogicalConnectionImplementorafterStatementExecution in interface LogicalConnectionImplementorpublic void afterTransaction()
LogicalConnectionImplementorafterTransaction in interface LogicalConnectionafterTransaction in interface LogicalConnectionImplementorpublic void disableReleases()
LogicalConnectionImplementordisableReleases in interface LogicalConnectionImplementorpublic void enableReleases()
LogicalConnectionImplementorLogicalConnectionImplementor.disableReleases() call.enableReleases in interface LogicalConnectionImplementorpublic void aggressiveRelease()
public Connection manualDisconnect()
LogicalConnectionImplementormanualDisconnect in interface LogicalConnectionImplementorpublic void manualReconnect(Connection suppliedConnection)
LogicalConnectionImplementormanualReconnect in interface LogicalConnectionImplementorsuppliedConnection - For user supplied connection strategy the user needs to hand us the connection
with which to reconnect. It is an error to pass a connection in the other strategies.public boolean isAutoCommit()
isAutoCommit in interface LogicalConnectionImplementorpublic void notifyObserversStatementPrepared()
notifyObserversStatementPrepared in interface LogicalConnectionImplementorpublic boolean isReadyForSerialization()
isReadyForSerialization in interface LogicalConnectionImplementorpublic void serialize(ObjectOutputStream oos) throws IOException
IOExceptionpublic static LogicalConnectionImpl deserialize(ObjectInputStream ois, TransactionContext transactionContext) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionCopyright © 2012 JBoss by Red Hat. All Rights Reserved.