From d479253768d296a40b4f699e1de9b03c7146a97a Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Tue, 3 Dec 2013 14:03:28 -0800 Subject: Adding javadocs and Carbonado User Guide --- .../amazon/carbonado/txn/TransactionManager.html | 573 +++++++++++++++++++++ 1 file changed, 573 insertions(+) create mode 100644 apidocs/com/amazon/carbonado/txn/TransactionManager.html (limited to 'apidocs/com/amazon/carbonado/txn/TransactionManager.html') diff --git a/apidocs/com/amazon/carbonado/txn/TransactionManager.html b/apidocs/com/amazon/carbonado/txn/TransactionManager.html new file mode 100644 index 0000000..eae85dc --- /dev/null +++ b/apidocs/com/amazon/carbonado/txn/TransactionManager.html @@ -0,0 +1,573 @@ + + + + + + +TransactionManager (Carbonado 1.2.3 API) + + + + + + + +
+ + + + + +
+ + + +
+
com.amazon.carbonado.txn
+

Class TransactionManager<Txn>

+
+
+ +
+
    +
  • +
    Type Parameters:
    Txn - Transaction implementation
    +
    +
    +
    public abstract class TransactionManager<Txn>
    +extends java.lang.Object
    +
    Generic transaction manager for repositories.
    +
    Author:
    +
    Brian S O'Neill
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      protected abstract voidabortTxn(Txn txn) +
      Aborts and closes the given internal transaction.
      +
      protected voidattachNotification(Txn txn) +
      Called to notify internal method that transaction is attached.
      +
      voidclose(boolean suspend) +
      Closes all transaction scopes.
      +
      protected abstract booleancommitTxn(Txn txn) +
      Commits and closes the given internal transaction.
      +
      protected abstract TxncreateTxn(Txn parent, + IsolationLevel level) +
      Creates an internal transaction representation, with the optional parent + transaction.
      +
      protected TxncreateTxn(Txn parent, + IsolationLevel level, + int timeout, + java.util.concurrent.TimeUnit unit) +
      Creates an internal transaction representation, with the optional parent + transaction.
      +
      TransactionScope<Txn>detachLocalScope() +
      Detaches the thread-local TransactionScope from the current thread.
      +
      protected voiddetachNotification(Txn txn) +
      Called to notify internal method that transaction is detached.
      +
      booleanisClosed() 
      TransactionScope<Txn>localScope() +
      Returns the thread-local TransactionScope, creating it if needed.
      +
      protected voidreuseTxn(Txn txn) +
      Called when a transaction is about to be reused.
      +
      protected abstract IsolationLevelselectIsolationLevel(Transaction parent, + IsolationLevel level) +
      Returns supported isolation level, which may be higher.
      +
      protected voidsetForUpdate(Txn txn, + boolean forUpdate) +
      Called when the Transaction.setForUpdate method is called.
      +
      protected abstract booleansupportsForUpdate() +
      Return true if transactions support "for update" mode.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TransactionManager

        +
        public TransactionManager()
        +
      • +
      + + + + +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        localScope

        +
        public TransactionScope<Txn> localScope()
        +
        Returns the thread-local TransactionScope, creating it if needed.
        +
      • +
      + + + +
        +
      • +

        detachLocalScope

        +
        public TransactionScope<Txn> detachLocalScope()
        +
        Detaches the thread-local TransactionScope from the current thread. It + can be attached later, and to any thread + which does not currently have a TransactionScope.
        +
        Returns:
        detached thread-local TransactionScope or null if none
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        close

        +
        public void close(boolean suspend)
        +           throws RepositoryException
        +
        Closes all transaction scopes. Should be called only when repository is + closed.
        +
        Parameters:
        suspend - when true, indefinitely suspend all threads interacting + with transactions
        +
        Throws:
        +
        RepositoryException
        +
      • +
      + + + +
        +
      • +

        isClosed

        +
        public boolean isClosed()
        +
      • +
      + + + +
        +
      • +

        selectIsolationLevel

        +
        protected abstract IsolationLevel selectIsolationLevel(Transaction parent,
        +                                  IsolationLevel level)
        +
        Returns supported isolation level, which may be higher. If isolation + level cannot go higher (or lower than parent) then return null.
        +
        Parameters:
        parent - optional parent transaction
        level - desired isolation level (may be null)
        +
      • +
      + + + +
        +
      • +

        supportsForUpdate

        +
        protected abstract boolean supportsForUpdate()
        +
        Return true if transactions support "for update" mode.
        +
        Since:
        +
        1.2
        +
      • +
      + + + + + +
        +
      • +

        createTxn

        +
        protected abstract Txn createTxn(Txn parent,
        +            IsolationLevel level)
        +                          throws java.lang.Exception
        +
        Creates an internal transaction representation, with the optional parent + transaction. If parent is not null and real nested transactions are not + supported, simply return parent transaction for supporting fake nested + transactions.
        +
        Parameters:
        parent - optional parent transaction
        level - required isolation level
        +
        Returns:
        new transaction, parent transaction, or possibly null if required + isolation level is none
        +
        Throws:
        +
        java.lang.Exception
        +
      • +
      + + + + + +
        +
      • +

        createTxn

        +
        protected Txn createTxn(Txn parent,
        +            IsolationLevel level,
        +            int timeout,
        +            java.util.concurrent.TimeUnit unit)
        +                 throws java.lang.Exception
        +
        Creates an internal transaction representation, with the optional parent + transaction. If parent is not null and real nested transactions are not + supported, simply return parent transaction for supporting fake nested + transactions. + +

        The default implementation of this method just calls the regular + createTxn method, ignoring the timeout parameter.

        +
        Parameters:
        parent - optional parent transaction
        level - required isolation level
        timeout - desired timeout for lock acquisition, never negative
        unit - timeout unit, never null
        +
        Returns:
        new transaction, parent transaction, or possibly null if required + isolation level is none
        +
        Throws:
        +
        java.lang.Exception
        +
      • +
      + + + + + +
        +
      • +

        reuseTxn

        +
        protected void reuseTxn(Txn txn)
        +                 throws java.lang.Exception
        +
        Called when a transaction is about to be reused. The default + implementation of this method does nothing. Override if any preparation + is required to ready a transaction for reuse.
        +
        Parameters:
        txn - transaction to reuse, never null
        +
        Throws:
        +
        java.lang.Exception
        Since:
        +
        1.1.3
        +
      • +
      + + + + + +
        +
      • +

        setForUpdate

        +
        protected void setForUpdate(Txn txn,
        +                boolean forUpdate)
        +
        Called when the Transaction.setForUpdate method is called. The default + implementation of this method does nothing. Override if internal + transaction needs to switch modes.
        +
        Since:
        +
        1.2.1
        +
      • +
      + + + + + +
        +
      • +

        attachNotification

        +
        protected void attachNotification(Txn txn)
        +
        Called to notify internal method that transaction is attached. + The default implementation of this method does nothing. Override if + using remote transactions.
        +
        Parameters:
        txn - transaction that is attached, could be null if none exists
        Since:
        +
        1.2.2
        +
      • +
      + + + + + +
        +
      • +

        detachNotification

        +
        protected void detachNotification(Txn txn)
        +
        Called to notify internal method that transaction is detached. + The default implementation of this method does nothing. Override if + using remote transactions.
        +
        Parameters:
        txn - transaction that is dettached, could be null if none exists
        Since:
        +
        1.2.2
        +
      • +
      + + + + + +
        +
      • +

        commitTxn

        +
        protected abstract boolean commitTxn(Txn txn)
        +                              throws PersistException
        +
        Commits and closes the given internal transaction.
        +
        Returns:
        true if transaction object is still valid
        +
        Throws:
        +
        PersistException
        +
      • +
      + + + + + + +
    • +
    +
  • +
+
+
+ + +
+ + + + + +
+ + +

Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.

+ + -- cgit v1.2.3