public interface PersistentCollection<C>
extends java.io.Externalizable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
PersistentCollection.ChangeListener<C>
Basic callback interface for change tracking on the collection
|
static interface |
PersistentCollection.InitializationCallback<C>
Callback interface for ensuring working on loaded collections/maps
|
static interface |
PersistentCollection.InitializationListener<C>
Basic callback interface for loading/unloading
|
static interface |
PersistentCollection.Initializer<C> |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(PersistentCollection.ChangeListener<C> listener)
Register a change listener
|
void |
addListener(PersistentCollection.InitializationListener<C> listener)
Register a initialization listener
|
void |
clearDirty()
Clear the dirty state of the collection
|
PersistentCollection<C> |
clone(boolean uninitialize)
Clone a persistent collection
|
void |
dirty()
Mark the collection as dirty
|
Loader<C> |
getLoader()
Loader for the collection
|
void |
initialize(C content,
PersistentCollection.Initializer<C> initializer)
Mark the collection as initialized, called after the content is loaded
|
void |
initializing()
Mark the collection as currently initializing so next access do not trigger loading
|
boolean |
isDirty()
Is the collection dirty ?
|
void |
removeListener(PersistentCollection.ChangeListener<C> listener)
Unregister a change listener
|
void |
removeListener(PersistentCollection.InitializationListener<C> listener)
Unregister a initialization listener
|
void |
setLoader(Loader<C> loader)
Set a loader for the collection
|
void |
uninitialize()
Unload the collection and unset its initialized state
|
boolean |
wasInitialized()
Was the collection was initialized
|
void |
withInitialized(PersistentCollection.InitializationCallback<C> callback)
Execute the specified callback after ensuring the collection has been loaded
If it was not loaded, the callack is called asynchronously after loading is complete
|
boolean wasInitialized()
void uninitialize()
void initialize(C content, PersistentCollection.Initializer<C> initializer)
void initializing()
PersistentCollection<C> clone(boolean uninitialize)
uninitialize - true to get an uninitialized clone of a lazy collectionvoid setLoader(Loader<C> loader)
loader - loader that will be called when a lazy collection is accessedboolean isDirty()
void dirty()
void clearDirty()
void addListener(PersistentCollection.ChangeListener<C> listener)
listener - listenervoid removeListener(PersistentCollection.ChangeListener<C> listener)
listener - listenervoid addListener(PersistentCollection.InitializationListener<C> listener)
listener - listenervoid removeListener(PersistentCollection.InitializationListener<C> listener)
listener - listenervoid withInitialized(PersistentCollection.InitializationCallback<C> callback)
callback - callback method to execute