Interface ConnectionInfo
- All Known Implementing Classes:
MockConnectionInfo
public interface ConnectionInfo
Holds information about the associated
Connection.- Author:
- Tadaya Tsuyukubo
-
Method Summary
Modifier and TypeMethodDescriptionintReturns how many timesConnection.commitTransaction()method is called.Returns the connection ID.Returns the originalConnection.intReturns how many timesConnection.rollbackTransaction()method is called.intReturns how many timesConnection.beginTransaction()method is called.Returns theValueStoreassociated with the scope of the logical connection.voidIncrement commit count.voidIncrement rollback count.voidIncrement transaction count.booleanisClosed()Returns whether connection is closed or not.voidsetClosed(boolean closed) Setbooleanto indicate whether the connection is closed or not.
-
Method Details
-
getOriginalConnection
Returns the originalConnection.- Returns:
- connection;
nullis returned whenConnectionInfois evaluated before it is associated with an actual connection, for example, duringProxyExecutionListener.beforeMethod(MethodExecutionInfo)forConnectionFactory.create().
-
getConnectionId
Returns the connection ID.- Returns:
- connection ID;
nullis returned whenConnectionInfois 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:
trueif connection is closed
-
setClosed
void setClosed(boolean closed) Setbooleanto indicate whether the connection is closed or not.- Parameters:
closed- settrueifConnectionis closed
-
getValueStore
ValueStore getValueStore()Returns theValueStoreassociated with the scope of the logical connection.Values can be stored or retrieved from this store while connection is available.
- Returns:
- value store
-