org.qi4j.library.eventsourcing.domain.source
Class AbstractEventStoreMixin

java.lang.Object
  extended by org.qi4j.library.eventsourcing.domain.source.AbstractEventStoreMixin
All Implemented Interfaces:
Activatable, EventStore, EventStream
Direct Known Subclasses:
JdbmEventStoreService.JdbmEventStoreMixin, MemoryEventStoreService.MemoryEventStoreMixin

public abstract class AbstractEventStoreMixin
extends Object
implements EventStore, EventStream, Activatable

Base implementation for EventStores.


Field Summary
protected  ValueType domainEventType
           
protected  ValueType eventsType
           
protected  Identity identity
           
protected  Lock lock
           
protected  org.slf4j.Logger logger
           
protected  ModuleSPI module
           
 
Constructor Summary
AbstractEventStoreMixin()
           
 
Method Summary
 void activate()
          This is invoked on the service when the instance is being activated
protected  void lock()
          Fix for this bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6822370
 void passivate()
          This is invoked on the service when the instance is being passivated
 void registerListener(UnitOfWorkEventsListener subscriber)
           
 void storeEvents(UnitOfWorkDomainEventsValue events)
           
protected abstract  void storeEvents0(UnitOfWorkDomainEventsValue unitOfWorkDomainValue)
           
 void unregisterListener(UnitOfWorkEventsListener subscriber)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

identity

@This
protected Identity identity

logger

protected org.slf4j.Logger logger

domainEventType

protected ValueType domainEventType

eventsType

protected ValueType eventsType

lock

protected Lock lock

module

@Structure
protected ModuleSPI module
Constructor Detail

AbstractEventStoreMixin

public AbstractEventStoreMixin()
Method Detail

activate

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

Specified by:
activate in interface Activatable
Throws:
IOException

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

storeEvents

public void storeEvents(UnitOfWorkDomainEventsValue events)
                 throws IOException
Specified by:
storeEvents in interface EventStore
Throws:
IOException

registerListener

public void registerListener(UnitOfWorkEventsListener subscriber)
Specified by:
registerListener in interface EventStream

unregisterListener

public void unregisterListener(UnitOfWorkEventsListener subscriber)
Specified by:
unregisterListener in interface EventStream

storeEvents0

protected abstract void storeEvents0(UnitOfWorkDomainEventsValue unitOfWorkDomainValue)
                              throws IOException
Throws:
IOException

lock

protected void lock()
Fix for this bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6822370