public interface WriteableBeanDatabase extends BeanDatabase
BeanDatabase
. Types and instances can be
added to this in-memory databaseModifier and Type | Method and Description |
---|---|
WriteableType |
addType(java.lang.String typeName)
Adds a type of the given name
|
void |
commit()
This method should be called when the writeable database should become
the current database.
|
void |
commit(java.lang.Object commitMessage)
This method should be called when the writeable database should become
the current database.
|
WriteableType |
findOrAddWriteableType(java.lang.String typeName)
Gets or creates a writeable type with the given name
|
java.util.Set<WriteableType> |
getAllWriteableTypes()
Gets an unmodifiable set of all the types in the bean database
|
java.lang.Object |
getCommitMessage()
Gets the commit message for this writeable bean database
|
TwoPhaseResource |
getTwoPhaseResource()
Returns a two-phase resource that can be used by a
DynamicConfiguration to tie the transaction done by
this WriteableBeanDatabase into a commit done by the
DynamicConfiguration.
|
WriteableType |
getWriteableType(java.lang.String typeName)
Gets a writeable type of the given name
|
Type |
removeType(java.lang.String typeName)
Removed the given type and all of its instances from the database.
|
void |
setCommitMessage(java.lang.Object commitMessage)
Sets the commit message for this writeable bean database
|
dumpDatabase, dumpDatabase, dumpDatabaseAsString, getAllTypes, getInstance, getType
java.util.Set<WriteableType> getAllWriteableTypes()
WriteableType addType(java.lang.String typeName)
typeName
- The name of the type to addType removeType(java.lang.String typeName)
typeName
- The non-null type nameWriteableType getWriteableType(java.lang.String typeName)
typeName
- The non-null name of the type to fetchWriteableType findOrAddWriteableType(java.lang.String typeName)
typeName
- The non-null name of the type to find or createjava.lang.Object getCommitMessage()
void setCommitMessage(java.lang.Object commitMessage)
commitMessage
- The possibly null commit message
for this writeable bean databaseTwoPhaseResource getTwoPhaseResource()
void commit() throws java.lang.IllegalStateException, MultiException
java.lang.IllegalStateException
- if the current database has been modified
since this writeable database copy was createdMultiException
- if there were user implementations of BeanDatabaseUpdateListener
that failed by throwing exceptions this exception will be thrown wrapping those exceptionsvoid commit(java.lang.Object commitMessage) throws java.lang.IllegalStateException, MultiException
commitMessage
- An object to pass to any BeanDatabaseUpdateListener
that is registeredjava.lang.IllegalStateException
- if the current database has been modified
since this writeable database copy was createdMultiException
- if there were user implementations of BeanDatabaseUpdateListener
that failed by throwing exceptions this exception will be thrown wrapping those exceptions