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

Class BelatedCreator<T,E extends java.lang.Exception>

+
+
+ +
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    BelatedRepositoryCreator, BelatedStorageCreator
    +
    +
    +
    +
    public abstract class BelatedCreator<T,E extends java.lang.Exception>
    +extends java.lang.Object
    +
    Generic one-shot factory which supports late object creation. If the object + creation results in an exception or is taking too long, the object produced + instead is a bogus one. After retrying, if the real object is created, then + the bogus object turns into a wrapper to the real object. + +

    Note: If a bogus object is created, the wrapper cannot always be a drop-in + replacement for the real object. If the wrapper is cloned, it won't have the + same behavior as cloning the real object. Also, synchronizing on the wrapper + will not synchronize the real object.

    +
    Author:
    +
    Brian S O'Neill
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ModifierConstructor and Description
      protected BelatedCreator(java.lang.Class<T> type, + int minRetryDelayMillis) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      protected abstract TcreateBogus() +
      Create instance of bogus object.
      +
      protected voidcreatedNotification(T object) +
      Notification that createReal has produced the real object.
      +
      protected abstract TcreateReal() +
      Create instance of real object.
      +
      Tget(int timeoutMillis) +
      Returns real or bogus object.
      +
      protected abstract voidtimedOutNotification(long timedOutMillis) +
      Notification that createReal is taking too long.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

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

      Constructor Detail

      + + + +
        +
      • +

        BelatedCreator

        +
        protected BelatedCreator(java.lang.Class<T> type,
        +              int minRetryDelayMillis)
        +
        Parameters:
        type - type of object created
        minRetryDelayMillis - minimum milliseconds to wait before retrying + to create object after failure; if negative, never retry
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if type is null or is not an interface
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        get

        +
        public T get(int timeoutMillis)
        +      throws E extends java.lang.Exception
        +
        Returns real or bogus object. If real object is returned, then future + invocations of this method return the same real object instance. This + method waits for the real object to be created, if it is blocked. If + real object creation fails immediately, then this method will not wait, + returning a bogus object immediately instead.
        +
        Parameters:
        timeoutMillis - maximum time to wait for real object before + returning bogus one; if negative, potentially wait forever
        +
        Throws:
        +
        E - exception thrown from createReal
        +
        E extends java.lang.Exception
        +
      • +
      + + + +
        +
      • +

        createReal

        +
        protected abstract T createReal()
        +                         throws E extends java.lang.Exception
        +
        Create instance of real object. If there is a recoverable error creating + the object, return null. Any error logging must be performed by the + implementation of this method. If null is returned, expect this method + to be called again in the future.
        +
        Returns:
        real object, or null if there was a recoverable error
        +
        Throws:
        +
        E - unrecoverable error
        +
        E extends java.lang.Exception
        +
      • +
      + + + +
        +
      • +

        createBogus

        +
        protected abstract T createBogus()
        +
        Create instance of bogus object.
        +
      • +
      + + + +
        +
      • +

        timedOutNotification

        +
        protected abstract void timedOutNotification(long timedOutMillis)
        +
        Notification that createReal is taking too long. This can be used to log + a message.
        +
        Parameters:
        timedOutMillis - milliseconds waited before giving up
        +
      • +
      + + + + + +
        +
      • +

        createdNotification

        +
        protected void createdNotification(T object)
        +
        Notification that createReal has produced the real object. The default + implementation does nothing.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + +
+ + +

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

+ + -- cgit v1.2.3