Prevayler™
The Free Software
Prevalence Layer

org.prevayler.implementation.publishing
Interface TransactionPublisher

All Known Implementing Classes:
AbstractPublisher, ClientPublisher

public interface TransactionPublisher


Method Summary
 void addSubscriber(TransactionSubscriber subscriber, long initialTransaction)
          Updates the given subscriber with all transactions published since initialTransaction, returns and continues publishing all future transactions to him.
 Clock clock()
          Returns a Clock which is consistent with the Transaction publishing time.
 void close()
          Closes any files or other system resources opened by this TransactionPublisher.
 void publish(Transaction transaction)
          Publishes transaction to the subscribers synchronously.
 void removeSubscriber(TransactionSubscriber subscriber)
          Stops publishing future transactions to the given subscriber.
 

Method Detail

addSubscriber

public void addSubscriber(TransactionSubscriber subscriber,
                          long initialTransaction)
                   throws java.io.IOException,
                          java.lang.ClassNotFoundException
Updates the given subscriber with all transactions published since initialTransaction, returns and continues publishing all future transactions to him.

Throws:
java.io.IOException
java.lang.ClassNotFoundException

removeSubscriber

public void removeSubscriber(TransactionSubscriber subscriber)
Stops publishing future transactions to the given subscriber.


publish

public void publish(Transaction transaction)
Publishes transaction to the subscribers synchronously. This method will only return after all subscribers have received transaction. Note that no guarantee can be made as to wether the subscribers have actually executed it.


clock

public Clock clock()
Returns a Clock which is consistent with the Transaction publishing time.


close

public void close()
           throws java.io.IOException
Closes any files or other system resources opened by this TransactionPublisher.

Throws:
java.io.IOException


'Prevayler' is a trademark of Klaus Wuestefeld.
Copyleft 2001-2004 Klaus Wuestefeld.