Interface ConnectionInfo

All Known Implementing Classes:
MockConnectionInfo

public interface ConnectionInfo
Hold Connection related information.
Author:
Tadaya Tsuyukubo
  • Method Details

    • getOriginalConnection

      @Nullable Connection getOriginalConnection()
      Retrieve original Connection.
      Returns:
      connection; null is returned when ConnectionInfo is evaluated before it is associated with an actual connection, for example, during ProxyExecutionListener.beforeMethod(MethodExecutionInfo) for ConnectionFactory.create().
    • getConnectionId

      @Nullable String getConnectionId()
      Get ID for the connection.
      Returns:
      connection ID; null is returned when ConnectionInfo is evaluated before it is associated with an actual connection, for example, during ProxyExecutionListener.beforeMethod(MethodExecutionInfo) for ConnectionFactory.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 times Connection.beginTransaction() method is called.
      Returns:
      num of beginTransaction() method being called
    • getCommitCount

      int getCommitCount()
      Returns how many times Connection.commitTransaction() method is called.
      Returns:
      num of commitTransaction method being called
    • getRollbackCount

      int getRollbackCount()
      Returns how many times Connection.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)
      Set boolean to indicate whether the connection is closed or not.
      Parameters:
      closed - set true if Connection is closed
    • getValueStore

      ValueStore getValueStore()
      Retrieve ValueStore 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