KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > tx > ServerTransactionManager


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.objectserver.tx;
5
6 import com.tc.net.protocol.tcm.ChannelID;
7 import com.tc.object.gtx.GlobalTransactionID;
8 import com.tc.object.tx.TransactionID;
9 import com.tc.objectserver.api.ObjectInstanceMonitor;
10 import com.tc.objectserver.managedobject.BackReferences;
11 import com.tc.objectserver.persistence.api.PersistenceTransaction;
12
13 import java.util.Collection JavaDoc;
14 import java.util.Map JavaDoc;
15 import java.util.Set JavaDoc;
16
17 public interface ServerTransactionManager {
18
19   /**
20    * Used to recover from client crashes this will acknowledge any waiter waiting for a downed client
21    *
22    * @param waitee
23    */

24   public void shutdownClient(ChannelID deadClient);
25
26   /**
27    * Add "waiter/requestID" is waiting for clientID "waitee" to respond to my message send
28    *
29    * @param waiter - ChannelID of the sender of the message that is waiting for a response
30    * @param requestID - The id of the request sent by the channel ID that is waiting for a response
31    * @param waitee - the channelID that waiter is waiting for a response from
32    */

33   public void addWaitingForAcknowledgement(ChannelID waiter, TransactionID requestID, ChannelID waitee);
34
35   /**
36    * Is the waiter done waiting or does it need to continue waiting?
37    *
38    * @param waiter - ChannelID of the sender of the message that is waiting for a response
39    * @param requestID - The id of the request sent by the channel ID that is waiting for a response
40    * @return
41    */

42   public boolean isWaiting(ChannelID waiter, TransactionID requestID);
43
44   /**
45    * received an acknowledgement from the client that the changes in the given transaction have been applied.
46    * This could potentially trigger an acknowledgement to the orginating client.
47    *
48    * @param waiter - ChannelID of the sender of the message that is waiting for a response
49    * @param requesterID - The id of the request sent by the channel ID that is waiting for a response
50    * @param gtxID - The GlobalTransactionID associated with the transaction.
51    * @param waitee - the channelID that waiter is waiting for a response from
52    */

53   public void acknowledgement(ChannelID waiter, TransactionID requestID, ChannelID waitee);
54
55   /**
56    * Apply the changes in the given transaction to the given set of checked out objects.
57    * @param instanceMonitor
58    *
59    * @return The results of the transaction apply
60    */

61   public void apply(GlobalTransactionID gtxID, ServerTransaction txn, Map JavaDoc objects, BackReferences includeIDs,
62                     ObjectInstanceMonitor instanceMonitor);
63   
64   /**
65    * The Objects will be checked back to the object manager
66    */

67   public void release(PersistenceTransaction ptx, Collection JavaDoc objects, Map JavaDoc newRoots);
68   
69   /**
70    * The set of transactions are commited.
71    * This could potentially trigger an acknowledgement to the orginating client.
72    */

73   public void committed(Collection JavaDoc txnIds);
74   
75   /**
76    * The broadcast stage is completed.
77    * This could potentially trigger an acknowledgement to the orginating client.
78    */

79   public void broadcasted(ChannelID waiter, TransactionID requestID);
80
81   public void dump();
82
83   /**
84    * Notifies the transaction managed that the given transaction is being skipped
85    */

86   public void skipApplyAndCommit(ServerTransaction txn);
87
88   public void setResentTransactionIDs(ChannelID channelID, Collection JavaDoc transactionIDs);
89   
90   public void addTransactionListener(ServerTransactionListener listener);
91
92   public void incomingTransactions(ChannelID channelID, Set JavaDoc serverTxnIDs, boolean relayed);
93
94   public void transactionsRelayed(ChannelID channelID, Set JavaDoc serverTxnIDs);
95 }
96
Popular Tags