KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > prevayler > implementation > publishing > TransactionPublisher


1 //Prevayler(TM) - The Free-Software Prevalence Layer.
2
//Copyright (C) 2001-2003 Klaus Wuestefeld
3
//This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
4

5 package org.prevayler.implementation.publishing;
6
7 import org.prevayler.Clock;
8 import org.prevayler.Transaction;
9
10 import java.io.IOException JavaDoc;
11
12
13 public interface TransactionPublisher {
14
15     /** Updates the given subscriber with all transactions published since initialTransaction, returns and continues publishing all future transactions to him.
16      */

17     public void addSubscriber(TransactionSubscriber subscriber, long initialTransaction) throws IOException JavaDoc, ClassNotFoundException JavaDoc;
18
19     /** Stops publishing future transactions to the given subscriber.
20      */

21     public void removeSubscriber(TransactionSubscriber subscriber);
22
23     /** 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.
24      */

25     public void publish(Transaction transaction);
26
27     /** Returns a Clock which is consistent with the Transaction publishing time.
28      */

29     public Clock clock();
30
31     /** Closes any files or other system resources opened by this TransactionPublisher.
32      */

33     public void close() throws IOException JavaDoc;
34
35 }
36
Popular Tags