public class MapRepositoryBuilder extends AbstractRepositoryBuilder
This repository supports transactions, which also may be nested. Supported isolation levels are read committed and serializable. Read uncommitted is promoted to read committed, and repeatable read is promoted to serializable.
The following extra capabilities are supported:
Note: This repository uses concurrent navigable map classes, which became available in JDK1.6.
Constructor and Description |
---|
MapRepositoryBuilder() |
Modifier and Type | Method and Description |
---|---|
Repository |
build(java.util.concurrent.atomic.AtomicReference<Repository> rootRef)
Builds a repository instance.
|
int |
getLockTimeout()
Returns the lock timeout.
|
java.util.concurrent.TimeUnit |
getLockTimeoutUnit()
Returns the lock timeout unit.
|
java.lang.String |
getName()
Returns the name of the repository.
|
boolean |
isMaster()
Returns true if repository should assume the role of master, which is
true by default.
|
static Repository |
newRepository()
Convenience method to build a new MapRepository.
|
void |
setLockTimeout(int timeout,
java.util.concurrent.TimeUnit unit)
Set the lock timeout.
|
void |
setLockTimeoutMillis(int timeout)
Set the lock timeout, in milliseconds.
|
void |
setMaster(boolean b)
Set to false if repository should not assume the role of master.
|
void |
setName(java.lang.String name)
Set name for the repository, which is required.
|
addTriggerFactory, assertReady, build, errorCheck, getTriggerFactories, removeTriggerFactory
public static Repository newRepository()
public Repository build(java.util.concurrent.atomic.AtomicReference<Repository> rootRef) throws RepositoryException
RepositoryBuilder
If the repository is being wrapped by a parent repository, the child repository will need to know this fact for some operations to work correctly. Since the parent repository is not built yet, a reference is used instead.
rootRef
- reference to root parent repository, to be set by
parent repository upon being builtConfigurationException
- if there is a problem in the builder's configurationRepositoryException
- if there is a general problem opening the repositorypublic java.lang.String getName()
RepositoryBuilder
public void setName(java.lang.String name)
RepositoryBuilder
public boolean isMaster()
RepositoryBuilder
A master repository is responsible for version
and
sequence
properties. For insert operations, a master
repository must set these properties if they are uninitialized. For
updates, the version property is checked to see if an OptimisticLockException
should be thrown.
ReplicatedRepositoryBuilder
public void setMaster(boolean b)
RepositoryBuilder
A master repository is responsible for version
and
sequence
properties. For insert operations, a master
repository must set these properties if they are uninitialized. For
updates, the version property is checked to see if an OptimisticLockException
should be thrown.
ReplicatedRepositoryBuilder
public void setLockTimeoutMillis(int timeout)
public void setLockTimeout(int timeout, java.util.concurrent.TimeUnit unit)
public int getLockTimeout()
public java.util.concurrent.TimeUnit getLockTimeoutUnit()
Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.