org.qi4j.entitystore.map
Class MapEntityStoreMixin

java.lang.Object
  extended by org.qi4j.entitystore.map.MapEntityStoreMixin
All Implemented Interfaces:
Activatable, StateStore, EntityStore, EntityStoreSPI

public class MapEntityStoreMixin
extends java.lang.Object
implements EntityStore, EntityStoreSPI, StateStore, Activatable

Implementation of EntityStore that works with an implementation of MapEntityStore. Implement MapEntityStore and add as mixin to the service using this mixin. See MemoryMapEntityStoreMixin for reference.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.qi4j.spi.entitystore.EntityStore
EntityStore.EntityStateVisitor<ThrowableType extends java.lang.Throwable>
 
Field Summary
protected  java.lang.String uuid
           
 
Constructor Summary
MapEntityStoreMixin()
           
 
Method Summary
 void activate()
           
 StateCommitter applyChanges(EntityStoreUnitOfWork unitofwork, java.lang.Iterable<EntityState> state, java.lang.String version, long lastModified)
           
 EntityState getEntityState(EntityStoreUnitOfWork unitofwork, EntityReference identity)
           
 JSONObject getState(java.lang.String id)
           
 EntityState newEntityState(EntityStoreUnitOfWork unitOfWork, EntityReference identity, EntityDescriptor entityDescriptor)
           
 EntityStoreUnitOfWork newUnitOfWork(Usecase usecaseMetaInfo, ModuleSPI module)
           
protected  java.lang.String newUnitOfWorkId()
           
 void passivate()
           
protected  EntityState readEntityState(DefaultEntityStoreUnitOfWork unitOfWork, java.io.Reader entityState)
           
<ThrowableType extends java.lang.Throwable>
EntityStoreUnitOfWork
visitEntityStates(EntityStore.EntityStateVisitor<ThrowableType> visitor, ModuleSPI moduleInstance)
           
protected  void writeEntityState(DefaultEntityState state, java.io.Writer writer, java.lang.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 java.lang.String uuid
Constructor Detail

MapEntityStoreMixin

public MapEntityStoreMixin()
Method Detail

activate

public void activate()
              throws java.lang.Exception
Specified by:
activate in interface Activatable
Throws:
java.lang.Exception

passivate

public void passivate()
               throws java.lang.Exception
Specified by:
passivate in interface Activatable
Throws:
java.lang.Exception

newUnitOfWork

public EntityStoreUnitOfWork newUnitOfWork(Usecase usecaseMetaInfo,
                                           ModuleSPI module)
Specified by:
newUnitOfWork 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,
                                   java.lang.Iterable<EntityState> state,
                                   java.lang.String version,
                                   long lastModified)
                            throws EntityStoreException
Specified by:
applyChanges in interface EntityStoreSPI
Throws:
EntityStoreException

visitEntityStates

public <ThrowableType extends java.lang.Throwable> EntityStoreUnitOfWork visitEntityStates(EntityStore.EntityStateVisitor<ThrowableType> visitor,
                                                                                           ModuleSPI moduleInstance)
                                        throws ThrowableType extends java.lang.Throwable
Specified by:
visitEntityStates in interface EntityStore
Throws:
ThrowableType extends java.lang.Throwable

newUnitOfWorkId

protected java.lang.String newUnitOfWorkId()

writeEntityState

protected void writeEntityState(DefaultEntityState state,
                                java.io.Writer writer,
                                java.lang.String identity,
                                long lastModified)
                         throws EntityStoreException
Throws:
EntityStoreException

readEntityState

protected EntityState readEntityState(DefaultEntityStoreUnitOfWork unitOfWork,
                                      java.io.Reader entityState)
                               throws EntityStoreException
Throws:
EntityStoreException

getState

public JSONObject getState(java.lang.String id)
                    throws java.io.IOException
Specified by:
getState in interface StateStore
Throws:
java.io.IOException


Copyright © 2007-2010. All Rights Reserved.