@Service @ContractsProvided(value=Hub.class) @Visibility(value=LOCAL) public class HubImpl extends java.lang.Object implements Hub
Modifier and Type | Field and Description |
---|---|
private BeanDatabaseImpl |
currentDatabase |
private int |
inTransaction |
private IterableProvider<BeanDatabaseUpdateListener> |
listeners |
private java.lang.Object |
lock |
private static java.util.concurrent.atomic.AtomicLong |
revisionCounter |
Constructor and Description |
---|
HubImpl() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
activateCurrentDatabase(WriteableBeanDatabaseImpl writeableDatabase,
java.lang.Object commitMessage,
java.util.List<Change> changes,
java.util.LinkedList<BeanDatabaseUpdateListener> completedListeners) |
BeanDatabase |
getCurrentDatabase()
Gets the current database running in the system
|
WriteableBeanDatabase |
getWriteableDatabaseCopy()
Creates a writeable copy of the currently running
database.
|
(package private) java.util.LinkedList<BeanDatabaseUpdateListener> |
prepareCurrentDatabase(WriteableBeanDatabaseImpl writeableDatabase,
java.lang.Object commitMessage,
java.util.List<Change> changes) |
(package private) void |
rollbackCurrentDatabase(WriteableBeanDatabaseImpl writeableDatabase,
java.lang.Object commitMessage,
java.util.List<Change> changes,
java.util.LinkedList<BeanDatabaseUpdateListener> completedListeners) |
(package private) void |
setCurrentDatabase(WriteableBeanDatabaseImpl writeableDatabase,
java.lang.Object commitMessage,
java.util.List<Change> changes) |
private static final java.util.concurrent.atomic.AtomicLong revisionCounter
private final java.lang.Object lock
private BeanDatabaseImpl currentDatabase
@Inject private IterableProvider<BeanDatabaseUpdateListener> listeners
private int inTransaction
public BeanDatabase getCurrentDatabase()
Hub
getCurrentDatabase
in interface Hub
public WriteableBeanDatabase getWriteableDatabaseCopy()
Hub
WriteableBeanDatabase.commit()
method is called (and no other WriteableBeanDatabase.commit()
method has been called) then a read-only copye of the
WriteableBeanDatabase
will become the current database.
There is no requirement to eventually call the
WriteableBeanDatabase.commit()
methodgetWriteableDatabaseCopy
in interface Hub
java.util.LinkedList<BeanDatabaseUpdateListener> prepareCurrentDatabase(WriteableBeanDatabaseImpl writeableDatabase, java.lang.Object commitMessage, java.util.List<Change> changes)
void activateCurrentDatabase(WriteableBeanDatabaseImpl writeableDatabase, java.lang.Object commitMessage, java.util.List<Change> changes, java.util.LinkedList<BeanDatabaseUpdateListener> completedListeners)
void rollbackCurrentDatabase(WriteableBeanDatabaseImpl writeableDatabase, java.lang.Object commitMessage, java.util.List<Change> changes, java.util.LinkedList<BeanDatabaseUpdateListener> completedListeners)
void setCurrentDatabase(WriteableBeanDatabaseImpl writeableDatabase, java.lang.Object commitMessage, java.util.List<Change> changes)