org.qi4j.entitystore.prefs
Class PreferencesEntityStoreMixin

java.lang.Object
  extended by org.qi4j.entitystore.prefs.PreferencesEntityStoreMixin
All Implemented Interfaces:
Activatable, EntityStore, EntityStoreSPI

public class PreferencesEntityStoreMixin
extends Object
implements Activatable, EntityStore, EntityStoreSPI

Implementation of EntityStore that is backed by the Preferences API.

See Also:
Preferences

Field Summary
 org.slf4j.Logger logger
           
 ScheduledThreadPoolExecutor reloadExecutor
           
protected  String uuid
           
 
Constructor Summary
PreferencesEntityStoreMixin()
           
 
Method Summary
 void activate()
          This is invoked on the service when the instance is being activated
 StateCommitter applyChanges(EntityStoreUnitOfWork unitofwork, Iterable<EntityState> state, String version, long lastModified)
           
 Input<EntityState,EntityStoreException> entityStates(ModuleSPI module)
           
 EntityState getEntityState(EntityStoreUnitOfWork unitOfWork, EntityReference identity)
           
 EntityState newEntityState(EntityStoreUnitOfWork unitOfWork, EntityReference identity, EntityDescriptor entityDescriptor)
           
 EntityStoreUnitOfWork newUnitOfWork(Usecase usecase, ModuleSPI module)
           
protected  String newUnitOfWorkId()
           
 void passivate()
          This is invoked on the service when the instance is being passivated
protected  void writeEntityState(DefaultEntityState state, Preferences entityPrefs, String identity, long lastModified)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uuid

protected String uuid

logger

public org.slf4j.Logger logger

reloadExecutor

public ScheduledThreadPoolExecutor reloadExecutor
Constructor Detail

PreferencesEntityStoreMixin

public PreferencesEntityStoreMixin()
Method Detail

activate

public void activate()
              throws Exception
Description copied from interface: Activatable
This is invoked on the service when the instance is being activated

Specified by:
activate in interface Activatable
Throws:
Exception - if service could not be activated

passivate

public void passivate()
               throws Exception
Description copied from interface: Activatable
This is invoked on the service when the instance is being passivated

Specified by:
passivate in interface Activatable
Throws:
Exception - if the service could not be passivated

newUnitOfWork

public EntityStoreUnitOfWork newUnitOfWork(Usecase usecase,
                                           ModuleSPI module)
Specified by:
newUnitOfWork in interface EntityStore

entityStates

public Input<EntityState,EntityStoreException> entityStates(ModuleSPI module)
Specified by:
entityStates in interface EntityStore

newEntityState

public EntityState newEntityState(EntityStoreUnitOfWork unitOfWork,
                                  EntityReference identity,
                                  EntityDescriptor entityDescriptor)
Specified by:
newEntityState in interface EntityStoreSPI

getEntityState

public EntityState getEntityState(EntityStoreUnitOfWork unitOfWork,
                                  EntityReference identity)
Specified by:
getEntityState in interface EntityStoreSPI

applyChanges

public StateCommitter applyChanges(EntityStoreUnitOfWork unitofwork,
                                   Iterable<EntityState> state,
                                   String version,
                                   long lastModified)
Specified by:
applyChanges in interface EntityStoreSPI

writeEntityState

protected void writeEntityState(DefaultEntityState state,
                                Preferences entityPrefs,
                                String identity,
                                long lastModified)
                         throws EntityStoreException
Throws:
EntityStoreException

newUnitOfWorkId

protected String newUnitOfWorkId()