001: /*
002: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
003: * notice. All rights reserved.
004: */
005: package com.tc.objectserver.tx;
006:
007: import com.tc.net.groups.NodeID;
008: import com.tc.object.tx.TransactionID;
009: import com.tc.objectserver.api.ObjectInstanceMonitor;
010: import com.tc.objectserver.managedobject.BackReferences;
011: import com.tc.objectserver.persistence.api.PersistenceTransactionProvider;
012:
013: import java.util.Collection;
014: import java.util.Map;
015: import java.util.Set;
016:
017: public interface ServerTransactionManager {
018:
019: /**
020: * called when a Node (Client or Server) leaves.
021: */
022: public void shutdownNode(NodeID nodeID);
023:
024: /**
025: * Add "waiter/requestID" is waiting for clientID "waitee" to respond to my message send
026: *
027: * @param waiter - ChannelID of the sender of the message that is waiting for a response
028: * @param requestID - The id of the request sent by the channel ID that is waiting for a response
029: * @param waitee - the channelID that waiter is waiting for a response from
030: */
031: public void addWaitingForAcknowledgement(NodeID waiter,
032: TransactionID requestID, NodeID waitee);
033:
034: /**
035: * Is the waiter done waiting or does it need to continue waiting?
036: *
037: * @param waiter - ChannelID of the sender of the message that is waiting for a response
038: * @param requestID - The id of the request sent by the channel ID that is waiting for a response
039: * @return
040: */
041: public boolean isWaiting(NodeID waiter, TransactionID requestID);
042:
043: /**
044: * received an acknowledgement from the client that the changes in the given transaction have been applied. This could
045: * potentially trigger an acknowledgement to the orginating client.
046: *
047: * @param waiter - NodeID of the sender of the message that is waiting for a response
048: * @param requesterID - The id of the request sent by the channel ID that is waiting for a response
049: * @param gtxID - The GlobalTransactionID associated with the transaction.
050: * @param waitee - the channelID that waiter is waiting for a response from
051: */
052: public void acknowledgement(NodeID waiter, TransactionID requestID,
053: NodeID waitee);
054:
055: /**
056: * Apply the changes in the given transaction to the given set of checked out objects.
057: *
058: * @param instanceMonitor
059: */
060: public void apply(ServerTransaction txn, Map objects,
061: BackReferences includeIDs,
062: ObjectInstanceMonitor instanceMonitor);
063:
064: /**
065: * Commits all the changes in objects and releases the objects This could potentially trigger an acknowledgement to
066: * the orginating client.
067: */
068: public void commit(PersistenceTransactionProvider ptxp,
069: Collection objects, Map newRoots,
070: Collection appliedServerTransactionIDs);
071:
072: /**
073: * The broadcast stage is completed. This could potentially trigger an acknowledgement to the orginating client.
074: */
075: public void broadcasted(NodeID waiter, TransactionID requestID);
076:
077: public void dump();
078:
079: /**
080: * Notifies the transaction managed that the given transaction is being skipped
081: */
082: public void skipApplyAndCommit(ServerTransaction txn);
083:
084: public void addTransactionListener(
085: ServerTransactionListener listener);
086:
087: public void removeTransactionListener(
088: ServerTransactionListener listener);
089:
090: public void callBackOnTxnsInSystemCompletion(
091: TxnsInSystemCompletionLister l);
092:
093: public void incomingTransactions(NodeID nodeID, Set txnIDs,
094: Collection txns, boolean relayed);
095:
096: public void transactionsRelayed(NodeID node, Set serverTxnIDs);
097:
098: public void setResentTransactionIDs(NodeID source,
099: Collection transactionIDs);
100:
101: public void start(Set cids);
102:
103: public void goToActiveMode();
104:
105: }
|