org.qi4j.library.eventsourcing.application.source
Class AbstractApplicationEventStoreMixin

java.lang.Object
  extended by org.qi4j.library.eventsourcing.application.source.AbstractApplicationEventStoreMixin
All Implemented Interfaces:
Activatable, ApplicationEventStore, ApplicationEventStream

public abstract class AbstractApplicationEventStoreMixin
extends Object
implements ApplicationEventStore, ApplicationEventStream, Activatable

Base implementation for ApplicationEventStores.


Field Summary
protected  ValueType domainEventType
           
protected  Identity identity
           
protected  Lock lock
           
protected  org.slf4j.Logger logger
           
protected  ModuleSPI module
           
protected  ValueType transactionEventsType
           
 
Constructor Summary
AbstractApplicationEventStoreMixin()
           
 
Method Summary
 void activate()
          This is invoked on the service when the instance is being activated
protected abstract  void commit()
           
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(Output<TransactionApplicationEvents,? extends Throwable> listener)
           
protected abstract  void rollback()
           
 TransactionApplicationEvents storeEvents(Iterable<ApplicationEvent> events)
           
protected abstract  void storeEvents(TransactionApplicationEvents transactionDomain)
           
 void unregisterListener(Output<TransactionApplicationEvents,? extends Throwable> listener)
           
 
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

transactionEventsType

protected ValueType transactionEventsType

lock

protected Lock lock

module

@Structure
protected ModuleSPI module
Constructor Detail

AbstractApplicationEventStoreMixin

public AbstractApplicationEventStoreMixin()
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 TransactionApplicationEvents storeEvents(Iterable<ApplicationEvent> events)
                                         throws IOException
Specified by:
storeEvents in interface ApplicationEventStore
Throws:
IOException

registerListener

public void registerListener(Output<TransactionApplicationEvents,? extends Throwable> listener)
Specified by:
registerListener in interface ApplicationEventStream

unregisterListener

public void unregisterListener(Output<TransactionApplicationEvents,? extends Throwable> listener)
Specified by:
unregisterListener in interface ApplicationEventStream

rollback

protected abstract void rollback()
                          throws IOException
Throws:
IOException

commit

protected abstract void commit()
                        throws IOException
Throws:
IOException

storeEvents

protected abstract void storeEvents(TransactionApplicationEvents transactionDomain)
                             throws IOException
Throws:
IOException

lock

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