com.amazon.carbonado.spi
Class BelatedRepositoryCreator
java.lang.Object
com.amazon.carbonado.util.BelatedCreator<Repository,SupportException>
com.amazon.carbonado.spi.BelatedRepositoryCreator
public class BelatedRepositoryCreator
- extends BelatedCreator<Repository,SupportException>
Generic one-shot Repository builder which supports late object creation. If
the Repository building results in an exception or is taking too long, the
Repository produced instead is a bogus one. Many operations result in an
IllegalStateException. After retrying, if the real Repository is created,
then the bogus Repository turns into a wrapper to the real Repository.
- Author:
- Brian S O'Neill
- See Also:
BelatedStorageCreator
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BelatedRepositoryCreator
public BelatedRepositoryCreator(org.apache.commons.logging.Log log,
RepositoryBuilder builder,
int minRetryDelayMillis)
- Parameters:
log - error reporting logbuilder - builds real RepositoryminRetryDelayMillis - minimum milliseconds to wait before retrying
to create object after failure; if negative, never retry
BelatedRepositoryCreator
public BelatedRepositoryCreator(org.apache.commons.logging.Log log,
RepositoryBuilder builder,
AtomicReference<Repository> rootRef,
int minRetryDelayMillis)
- Parameters:
log - error reporting logbuilder - builds real RepositoryrootRef - reference to root repositoryminRetryDelayMillis - minimum milliseconds to wait before retrying
to create object after failure; if negative, never retry
createReal
protected Repository createReal()
throws SupportException
- Description copied from class:
BelatedCreator
- 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.
- Specified by:
createReal in class BelatedCreator<Repository,SupportException>
- Returns:
- real object, or null if there was a recoverable error
- Throws:
SupportException
createBogus
protected Repository createBogus()
- Description copied from class:
BelatedCreator
- Create instance of bogus object.
- Specified by:
createBogus in class BelatedCreator<Repository,SupportException>
timedOutNotification
protected void timedOutNotification(long timedOutMillis)
- Description copied from class:
BelatedCreator
- Notification that createReal is taking too long. This can be used to log
a message.
- Specified by:
timedOutNotification in class BelatedCreator<Repository,SupportException>
- Parameters:
timedOutMillis - milliseconds waited before giving up
Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.