Prevayler™
The Free Software
Prevalence Layer

org.prevayler.implementation.publishing
Class CentralPublisher

java.lang.Object
  extended byorg.prevayler.implementation.publishing.AbstractPublisher
      extended byorg.prevayler.implementation.publishing.CentralPublisher
All Implemented Interfaces:
TransactionPublisher

public class CentralPublisher
extends AbstractPublisher


Field Summary
 
Fields inherited from class org.prevayler.implementation.publishing.AbstractPublisher
_clock
 
Constructor Summary
CentralPublisher(Clock clock, TransactionCensor censor, TransactionLogger logger)
           
 
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.
 void close()
          Closes any files or other system resources opened by this TransactionPublisher.
 void publish(Transaction transaction)
          Publishes transaction to the subscribers synchronously.
 
Methods inherited from class org.prevayler.implementation.publishing.AbstractPublisher
addSubscriber, clock, notifySubscribers, removeSubscriber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CentralPublisher

public CentralPublisher(Clock clock,
                        TransactionCensor censor,
                        TransactionLogger logger)
Method Detail

publish

public void publish(Transaction transaction)
Description copied from interface: TransactionPublisher
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.


addSubscriber

public void addSubscriber(TransactionSubscriber subscriber,
                          long initialTransaction)
                   throws java.io.IOException,
                          java.lang.ClassNotFoundException
Description copied from interface: TransactionPublisher
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

close

public void close()
           throws java.io.IOException
Description copied from interface: TransactionPublisher
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.