Interface ConnectionInfo
- All Known Implementing Classes:
MockConnectionInfo
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns how many timesConnection.commitTransaction()
method is called.Get ID for the connection.Retrieve originalConnection
.int
Returns how many timesConnection.rollbackTransaction()
method is called.int
Returns how many timesConnection.beginTransaction()
method is called.RetrieveValueStore
which is associated to the scope of logical connection.void
Increment commit count.void
Increment rollback count.void
Increment transaction count.boolean
isClosed()
Returns whether connection is closed or not.void
setClosed
(boolean closed) Setboolean
to indicate whether the connection is closed or not.
-
Method Details
-
getOriginalConnection
Retrieve originalConnection
.- Returns:
- connection;
null
is returned whenConnectionInfo
is evaluated before it is associated with an actual connection, for example, duringProxyExecutionListener.beforeMethod(MethodExecutionInfo)
forConnectionFactory.create()
.
-
getConnectionId
Get ID for the connection.- Returns:
- connection ID;
null
is returned whenConnectionInfo
is evaluated before it is associated with an actual connection, for example, duringProxyExecutionListener.beforeMethod(MethodExecutionInfo)
forConnectionFactory.create()
. - See Also:
-
incrementTransactionCount
void incrementTransactionCount()Increment transaction count. -
incrementCommitCount
void incrementCommitCount()Increment commit count. -
incrementRollbackCount
void incrementRollbackCount()Increment rollback count. -
getTransactionCount
int getTransactionCount()Returns how many timesConnection.beginTransaction()
method is called.- Returns:
- num of beginTransaction() method being called
-
getCommitCount
int getCommitCount()Returns how many timesConnection.commitTransaction()
method is called.- Returns:
- num of commitTransaction method being called
-
getRollbackCount
int getRollbackCount()Returns how many timesConnection.rollbackTransaction()
method is called.- Returns:
- num of rollback methods being called
-
isClosed
boolean isClosed()Returns whether connection is closed or not.- Returns:
true
if connection is closed
-
setClosed
void setClosed(boolean closed) Setboolean
to indicate whether the connection is closed or not.- Parameters:
closed
- settrue
ifConnection
is closed
-
getValueStore
ValueStore getValueStore()RetrieveValueStore
which is associated to the scope of logical connection.Values can be stored or retrieved from this store while connection is available.
- Returns:
- value store
-