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/spi/AbstractRepository.html | 759 +++++++++++++++++++++ 1 file changed, 759 insertions(+) create mode 100644 apidocs/com/amazon/carbonado/spi/AbstractRepository.html (limited to 'apidocs/com/amazon/carbonado/spi/AbstractRepository.html') diff --git a/apidocs/com/amazon/carbonado/spi/AbstractRepository.html b/apidocs/com/amazon/carbonado/spi/AbstractRepository.html new file mode 100644 index 0000000..1e5daa2 --- /dev/null +++ b/apidocs/com/amazon/carbonado/spi/AbstractRepository.html @@ -0,0 +1,759 @@ + + + + + + +AbstractRepository (Carbonado 1.2.3 API) + + + + + + + +
+ + + + + +
+ + + +
+
com.amazon.carbonado.spi
+

Class AbstractRepository<Txn>

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ModifierConstructor and Description
      protected AbstractRepository(java.lang.String name) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      protected java.util.Collection<Storage>allStorage() +
      Returns all available Storage instances.
      +
      voidclose() +
      Closes this repository reference, aborting any current + transactions.
      +
      protected abstract SequenceValueProducercreateSequenceValueProducer(java.lang.String name) +
      Called upon to create a new SequenceValueProducer instance.
      +
      protected abstract <S extends Storable
      Storage<S>
      createStorage(java.lang.Class<S> type) +
      Called upon to create a new Storage instance.
      +
      TransactionenterTopTransaction(IsolationLevel level) +
      Causes the current thread to enter a top-level transaction scope + with an explict isolation level.
      +
      TransactionenterTransaction() +
      Causes the current thread to enter a transaction scope.
      +
      TransactionenterTransaction(IsolationLevel level) +
      Causes the current thread to enter a transaction scope with an explict + isolation level.
      +
      <C extends Capability
      C
      getCapability(java.lang.Class<C> capabilityType) +
      Default implementation checks if Repository implements Capability + interface, and if so, returns the Repository.
      +
      protected abstract org.apache.commons.logging.LoggetLog() +
      Return the main Log object for this Repository.
      +
      java.lang.StringgetName() +
      Returns the name of this repository.
      +
      SequenceValueProducergetSequenceValueProducer(java.lang.String name) +
      Retrieve and/or generate a SequenceValueProducer for the given name.
      +
      IsolationLevelgetTransactionIsolationLevel() +
      Returns the isolation level of the current transaction, or null if there + is no transaction in the current thread.
      +
      booleanisAutoShutdownEnabled() +
      Returns true if repository has a shutdown hook registered to + automatically call shutdown when the virtual machine exits.
      +
      booleanisClosed() 
      protected abstract TransactionScope<Txn>localTransactionScope() +
      Returns the thread-local TransactionScope, creating it if needed.
      +
      protected voidlockoutShutdown() +
      Call to prevent shutdown hook from running.
      +
      voidsetAutoShutdownEnabled(boolean enabled) +
      Request to enable or disable the automatic shutdown hook.
      +
      voidshutdown() +
      Similar to calling close on a repository, except should only be called + when the virtual machine is in the process of shutting down.
      +
      protected voidshutdownHook() +
      Install custom shutdown logic by overriding this method.
      +
      <S extends Storable
      Storage<S>
      storageFor(java.lang.Class<S> type) +
      Returns a Storage instance for the given user defined Storable class or + interface.
      +
      protected abstract TransactionManager<Txn>transactionManager() +
      Returns the repository's TransactionManager.
      +
      protected voidunlockoutShutdown() +
      Only call this to release lockoutShutdown.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

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

      Constructor Detail

      + + + +
        +
      • +

        AbstractRepository

        +
        protected AbstractRepository(java.lang.String name)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getName

        +
        public java.lang.String getName()
        +
        Description copied from interface: Repository
        +
        Returns the name of this repository.
        +
        +
        Specified by:
        +
        getName in interface Repository
        +
        +
      • +
      + + + + + + + +
        +
      • +

        enterTransaction

        +
        public Transaction enterTransaction()
        +
        Description copied from interface: Repository
        +
        Causes the current thread to enter a transaction scope. Call commit + inside the transaction in order for any updates to the repository to be + applied. Be sure to call exit when leaving the scope. +

        + To ensure exit is called, use transactions as follows: +

        + Transaction txn = repository.enterTransaction();
        + try {
        +     // Make updates to storage layer
        +     ...
        +
        +     // Commit the changes up to this point
        +     txn.commit();
        +
        +     // Optionally make more updates
        +     ...
        +
        +     // Commit remaining changes
        +     txn.commit();
        + } finally {
        +     // Ensure transaction exits, aborting uncommitted changes if an exception was thrown
        +     txn.exit();
        + }
        + 
        +
        +
        Specified by:
        +
        enterTransaction in interface Repository
        +
        +
      • +
      + + + +
        +
      • +

        enterTransaction

        +
        public Transaction enterTransaction(IsolationLevel level)
        +
        Description copied from interface: Repository
        +
        Causes the current thread to enter a transaction scope with an explict + isolation level. The actual isolation level may be higher than + requested, if the repository does not support the exact level. If the + repository does not support a high enough level, it throws an + UnsupportedOperationException.
        +
        +
        Specified by:
        +
        enterTransaction in interface Repository
        +
        Parameters:
        level - minimum desired transaction isolation level -- if null, a + suitable default is selected
        See Also:
        Repository.enterTransaction()
        +
      • +
      + + + +
        +
      • +

        enterTopTransaction

        +
        public Transaction enterTopTransaction(IsolationLevel level)
        +
        Description copied from interface: Repository
        +
        Causes the current thread to enter a top-level transaction scope + with an explict isolation level. The actual isolation level may be + higher than requested, if the repository does not support the exact + level. If the repository does not support a high enough level, it throws + an UnsupportedOperationException. + +

        This method requests a top-level transaction, which means it never + has a parent transaction, but it still can be a parent transaction + itself. This kind of transaction is useful when a commit must absolutely + succeed, even if the current thread is already in a transaction + scope. If there was a parent transaction, then a commit might still be + rolled back by the parent. + +

        Requesting a top-level transaction can be deadlock prone if the + current thread is already in a transaction scope. The top-level + transaction may not be able to obtain locks held by the parent + transaction. An alternative to requesting top-level transactions is to + execute transactions in separate threads.

        +
        +
        Specified by:
        +
        enterTopTransaction in interface Repository
        +
        Parameters:
        level - minimum desired transaction isolation level -- if null, a + suitable default is selected
        See Also:
        Repository.enterTransaction()
        +
      • +
      + + + +
        +
      • +

        getTransactionIsolationLevel

        +
        public IsolationLevel getTransactionIsolationLevel()
        +
        Description copied from interface: Repository
        +
        Returns the isolation level of the current transaction, or null if there + is no transaction in the current thread.
        +
        +
        Specified by:
        +
        getTransactionIsolationLevel in interface Repository
        +
        +
      • +
      + + + +
        +
      • +

        getCapability

        +
        public <C extends Capability> C getCapability(java.lang.Class<C> capabilityType)
        +
        Default implementation checks if Repository implements Capability + interface, and if so, returns the Repository.
        +
        +
        Specified by:
        +
        getCapability in interface Repository
        +
        Parameters:
        capabilityType - type of capability requested
        +
        Returns:
        capability instance or null if not supported
        +
      • +
      + + + +
        +
      • +

        close

        +
        public void close()
        +
        Description copied from interface: Repository
        +
        Closes this repository reference, aborting any current + transactions. Operations on objects returned by this repository will + fail when accessing the storage layer.
        +
        +
        Specified by:
        +
        close in interface Repository
        +
        +
      • +
      + + + +
        +
      • +

        isClosed

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

        isAutoShutdownEnabled

        +
        public boolean isAutoShutdownEnabled()
        +
        Description copied from interface: ShutdownCapability
        +
        Returns true if repository has a shutdown hook registered to + automatically call shutdown when the virtual machine exits.
        +
        +
        Specified by:
        +
        isAutoShutdownEnabled in interface ShutdownCapability
        +
        +
      • +
      + + + +
        +
      • +

        setAutoShutdownEnabled

        +
        public void setAutoShutdownEnabled(boolean enabled)
        +
        Description copied from interface: ShutdownCapability
        +
        Request to enable or disable the automatic shutdown hook. Repository may + ignore this request if shutdown is in progress.
        +
        +
        Specified by:
        +
        setAutoShutdownEnabled in interface ShutdownCapability
        +
        +
      • +
      + + + +
        +
      • +

        shutdown

        +
        public void shutdown()
        +
        Description copied from interface: ShutdownCapability
        +
        Similar to calling close on a repository, except should only be called + when the virtual machine is in the process of shutting down. Calling + close may cause spurious exceptions to be thrown by other threads which + may be interacting with the repository. Shutdown tries to reduce these + exceptions from being thrown by effectively suspending any + threads which continue to interact with this repository. For this + reason, this method should only ever be called during a virtual machine + shutdown. + +

        Repositories may choose to implement this method by simply calling + close. There is no guarantee that shutdown will reduce exceptions, and + it might not suspend any threads. Also, repositories that require proper + shutdown should automatically register runtime hooks, and so this method + usually doesn't need to be called manually.

        +
        +
        Specified by:
        +
        shutdown in interface ShutdownCapability
        +
        +
      • +
      + + + + + + + +
        +
      • +

        transactionManager

        +
        protected abstract TransactionManager<Txn> transactionManager()
        +
        Returns the repository's TransactionManager.
        +
      • +
      + + + +
        +
      • +

        localTransactionScope

        +
        protected abstract TransactionScope<Txn> localTransactionScope()
        +
        Returns the thread-local TransactionScope, creating it if needed.
        +
      • +
      + + + +
        +
      • +

        lockoutShutdown

        +
        protected void lockoutShutdown()
        +
        Call to prevent shutdown hook from running. Be sure to call + unlockoutShutdown afterwards.
        +
      • +
      + + + +
        +
      • +

        unlockoutShutdown

        +
        protected void unlockoutShutdown()
        +
        Only call this to release lockoutShutdown.
        +
      • +
      + + + +
        +
      • +

        allStorage

        +
        protected java.util.Collection<Storage> allStorage()
        +
        Returns all available Storage instances.
        +
      • +
      + + + +
        +
      • +

        shutdownHook

        +
        protected void shutdownHook()
        +
        Install custom shutdown logic by overriding this method. By default it + does nothing.
        +
      • +
      + + + +
        +
      • +

        getLog

        +
        protected abstract org.apache.commons.logging.Log getLog()
        +
        Return the main Log object for this Repository. If none provided, then + no messages are logged by AbstractRepository.
        +
      • +
      + + + + + + + + +
    • +
    +
  • +
+
+
+ + +
+ + + + + +
+ + +

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

+ + -- cgit v1.2.3