com.amazon.carbonado.sequence
Class SequenceValueProducerPool
java.lang.Object
com.amazon.carbonado.util.AbstractPool<String,SequenceValueProducer,RepositoryException>
com.amazon.carbonado.sequence.SequenceValueProducerPool
public abstract class SequenceValueProducerPool
- extends AbstractPool<String,SequenceValueProducer,RepositoryException>
A concurrent pool of strongly referenced SequenceValueProducer
instances mapped by name. SequenceValueProducer instances are lazily created
and pooled.
- Since:
- 1.2
- Author:
- bcastill, Brian S O'Neill
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SequenceValueProducerPool
public SequenceValueProducerPool()
get
public SequenceValueProducer get(String name)
throws RepositoryException
- Returns a SequenceValueProducer instance for the given name, which is
lazily created and pooled. If multiple threads are requesting upon the
same name concurrently, at most one thread attempts to lazily create the
SequenceValueProducer. The others wait for it to become available.
- Overrides:
get in class AbstractPool<String,SequenceValueProducer,RepositoryException>
- Parameters:
name - name of sequence
- Throws:
RepositoryException
returnReservedValues
public void returnReservedValues(org.apache.commons.logging.Log log)
- Returns reserved values for all
SequenceValueProducers.
- Parameters:
log - optional log to report errors; uses default log if null
create
protected final SequenceValueProducer create(String name)
throws RepositoryException
- Description copied from class:
AbstractPool
- Return a new value instance.
- Specified by:
create in class AbstractPool<String,SequenceValueProducer,RepositoryException>
- Throws:
RepositoryException
createSequenceValueProducer
protected abstract SequenceValueProducer createSequenceValueProducer(String name)
throws RepositoryException
- Throws:
RepositoryException
Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.