public class PreferencesEntityStoreMixin extends Object implements ServiceActivation, EntityStore, EntityStoreSPI
@see Preferences
Associations are stored as the reference of the referenced Entity, ManyAssociations are stored as multi-line strings (one reference per line), and NamedAssociations are stored as multi-line strings (one name on a line, reference on the next line).
Nested ValuesComposites, Collections and Maps are stored using available StateSerialization service.
ServiceActivation.ServiceActivator
Modifier and Type | Field and Description |
---|---|
ScheduledThreadPoolExecutor |
reloadExecutor |
Constructor and Description |
---|
PreferencesEntityStoreMixin() |
Modifier and Type | Method and Description |
---|---|
void |
activateService()
Called after ServiceComposite Activation.
|
StateCommitter |
applyChanges(EntityStoreUnitOfWork unitofwork,
Iterable<EntityState> state) |
EntityState |
entityStateOf(EntityStoreUnitOfWork unitOfWork,
ModuleDescriptor module,
EntityReference reference) |
Stream<EntityState> |
entityStates(ModuleDescriptor module)
Stream of all entity states, must be closed.
|
EntityState |
newEntityState(EntityStoreUnitOfWork unitOfWork,
EntityReference reference,
EntityDescriptor entityDescriptor) |
EntityStoreUnitOfWork |
newUnitOfWork(ModuleDescriptor module,
Usecase usecase,
Instant currentTime) |
protected Identity |
newUnitOfWorkId() |
void |
passivateService()
Called before ServiceComposite Passivation.
|
String |
versionOf(EntityStoreUnitOfWork unitOfWork,
EntityReference reference) |
protected void |
writeEntityState(DefaultEntityState state,
Preferences entityPrefs,
Identity identity,
Instant lastModified) |
public ScheduledThreadPoolExecutor reloadExecutor
public void activateService() throws Exception
ServiceActivation
activateService
in interface ServiceActivation
Exception
- if unable to activatepublic void passivateService() throws Exception
ServiceActivation
passivateService
in interface ServiceActivation
Exception
- if unable to passivatepublic EntityStoreUnitOfWork newUnitOfWork(ModuleDescriptor module, Usecase usecase, Instant currentTime)
newUnitOfWork
in interface EntityStore
public Stream<EntityState> entityStates(ModuleDescriptor module)
EntityStore
entityStates
in interface EntityStore
module
- Modulepublic EntityState newEntityState(EntityStoreUnitOfWork unitOfWork, EntityReference reference, EntityDescriptor entityDescriptor)
newEntityState
in interface EntityStoreSPI
public EntityState entityStateOf(EntityStoreUnitOfWork unitOfWork, ModuleDescriptor module, EntityReference reference)
entityStateOf
in interface EntityStoreSPI
public String versionOf(EntityStoreUnitOfWork unitOfWork, EntityReference reference)
versionOf
in interface EntityStoreSPI
public StateCommitter applyChanges(EntityStoreUnitOfWork unitofwork, Iterable<EntityState> state)
applyChanges
in interface EntityStoreSPI
protected void writeEntityState(DefaultEntityState state, Preferences entityPrefs, Identity identity, Instant lastModified) throws EntityStoreException
EntityStoreException
protected Identity newUnitOfWorkId()