org.qi4j.entitystore.prefs
Class PreferencesEntityStoreMixin
java.lang.Object
org.qi4j.entitystore.prefs.PreferencesEntityStoreMixin
- All Implemented Interfaces:
- ServiceActivation, EntityStore, EntityStoreSPI
public class PreferencesEntityStoreMixin
- extends java.lang.Object
- implements ServiceActivation, EntityStore, EntityStoreSPI
Implementation of EntityStore that is backed by the Preferences API.
@see Preferences
ManyAssociation is stored as string, one identity string per line
Nested ValuesComposites, Collections and Maps are stored using available ValueSerialization service.
Field Summary |
org.slf4j.Logger |
logger
|
java.util.concurrent.ScheduledThreadPoolExecutor |
reloadExecutor
|
protected java.lang.String |
uuid
|
Method Summary |
void |
activateService()
Called after ServiceComposite Activation. |
StateCommitter |
applyChanges(EntityStoreUnitOfWork unitofwork,
java.lang.Iterable<EntityState> state)
|
EntityState |
entityStateOf(EntityStoreUnitOfWork unitOfWork,
EntityReference identity)
|
Input<EntityState,EntityStoreException> |
entityStates(Module module)
|
EntityState |
newEntityState(EntityStoreUnitOfWork unitOfWork,
EntityReference identity,
EntityDescriptor entityDescriptor)
|
EntityStoreUnitOfWork |
newUnitOfWork(Usecase usecase,
Module module,
long currentTime)
|
protected java.lang.String |
newUnitOfWorkId()
|
void |
passivateService()
Called before ServiceComposite Passivation. |
protected void |
writeEntityState(DefaultEntityState state,
java.util.prefs.Preferences entityPrefs,
java.lang.String identity,
long lastModified)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
uuid
protected java.lang.String uuid
logger
public org.slf4j.Logger logger
reloadExecutor
public java.util.concurrent.ScheduledThreadPoolExecutor reloadExecutor
PreferencesEntityStoreMixin
public PreferencesEntityStoreMixin()
activateService
public void activateService()
throws java.lang.Exception
- Description copied from interface:
ServiceActivation
- Called after ServiceComposite Activation.
- Specified by:
activateService
in interface ServiceActivation
- Throws:
java.lang.Exception
passivateService
public void passivateService()
throws java.lang.Exception
- Description copied from interface:
ServiceActivation
- Called before ServiceComposite Passivation.
- Specified by:
passivateService
in interface ServiceActivation
- Throws:
java.lang.Exception
newUnitOfWork
public EntityStoreUnitOfWork newUnitOfWork(Usecase usecase,
Module module,
long currentTime)
- Specified by:
newUnitOfWork
in interface EntityStore
entityStates
public Input<EntityState,EntityStoreException> entityStates(Module module)
- Specified by:
entityStates
in interface EntityStore
newEntityState
public EntityState newEntityState(EntityStoreUnitOfWork unitOfWork,
EntityReference identity,
EntityDescriptor entityDescriptor)
- Specified by:
newEntityState
in interface EntityStoreSPI
entityStateOf
public EntityState entityStateOf(EntityStoreUnitOfWork unitOfWork,
EntityReference identity)
- Specified by:
entityStateOf
in interface EntityStoreSPI
applyChanges
public StateCommitter applyChanges(EntityStoreUnitOfWork unitofwork,
java.lang.Iterable<EntityState> state)
- Specified by:
applyChanges
in interface EntityStoreSPI
writeEntityState
protected void writeEntityState(DefaultEntityState state,
java.util.prefs.Preferences entityPrefs,
java.lang.String identity,
long lastModified)
throws EntityStoreException
- Throws:
EntityStoreException
newUnitOfWorkId
protected java.lang.String newUnitOfWorkId()