com.h3c.util.persistence.cassandra.lockmgr

## Interface CassandraLockManager

-     public interface CassandraLockManager

  `CassandraLockManager` is the interface between the DAO and the lock manager. The DAO uses the `executeCriticalSection(com.h3c.util.Procedure<T>)` to execute a transaction based query. The implementation of the method encapsulates the begin and end of a given transaction.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> T` | `executeCriticalSection(Procedure<T> procedure)` This method executes the Critical section.

- - ### Method Detail

    - #### executeCriticalSection

          <T> T executeCriticalSection(Procedure<T> procedure)
                                   throws Exception

      This method executes the Critical section. The implementation should encapsulate the begin() and end() of a transaction from the client. The structure of the implementation looks like this.

               executeCriticalSection(Procedure procedure) {
                   // Begin the transaction
                   begin();
                   // Try critical section
                   try {
                      return procedure.execute();
                   } finally {
                      // End Transaction
                      end();
                   }
                }

      Parameters:
        `procedure` - This is the procedure object. See `Procedure` for more details.
      Returns:
        The transport object after execution of the critical section.
      Throws:
        `Exception`

Copyright © 2014. All Rights Reserved.