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.exception.ImplementMe;
008: import com.tc.net.groups.NodeID;
009: import com.tc.object.tx.TransactionID;
010: import com.tc.objectserver.api.ObjectInstanceMonitor;
011: import com.tc.objectserver.managedobject.BackReferences;
012: import com.tc.objectserver.persistence.api.PersistenceTransactionProvider;
013: import com.tc.util.concurrent.NoExceptionLinkedQueue;
014:
015: import java.util.ArrayList;
016: import java.util.Collection;
017: import java.util.List;
018: import java.util.Map;
019: import java.util.Set;
020:
021: public class TestServerTransactionManager implements
022: ServerTransactionManager {
023:
024: public final NoExceptionLinkedQueue skipCalls = new NoExceptionLinkedQueue();
025:
026: public TestServerTransactionManager() {
027: //
028: }
029:
030: public final NoExceptionLinkedQueue shutdownClientCalls = new NoExceptionLinkedQueue();
031: public final ArrayList incomingTxnContexts = new ArrayList();
032: public final List incomingTxns = new ArrayList();
033:
034: public void shutdownNode(NodeID deadClient) {
035: shutdownClientCalls.put(deadClient);
036: }
037:
038: public void addWaitingForAcknowledgement(NodeID waiter,
039: TransactionID requestID, NodeID waitee) {
040: throw new ImplementMe();
041:
042: }
043:
044: public boolean isWaiting(NodeID waiter, TransactionID requestID) {
045: throw new ImplementMe();
046: }
047:
048: public void acknowledgement(NodeID waiter, TransactionID requestID,
049: NodeID waitee) {
050: throw new ImplementMe();
051: }
052:
053: public void dump() {
054: throw new ImplementMe();
055: }
056:
057: public void broadcasted(NodeID waiter, TransactionID requestID) {
058: // NOP
059: }
060:
061: public void skipApplyAndCommit(ServerTransaction txn) {
062: skipCalls.put(txn);
063: }
064:
065: public void addTransactionListener(
066: ServerTransactionListener listener) {
067: // NOP
068: }
069:
070: public void removeTransactionListener(
071: ServerTransactionListener listener) {
072: // NOP
073: }
074:
075: public void apply(ServerTransaction txn, Map objects,
076: BackReferences includeIDs,
077: ObjectInstanceMonitor instanceMonitor) {
078: // NOP
079: }
080:
081: public void incomingTransactions(NodeID nodeID, Set txnIDs,
082: Collection txns, boolean relayed) {
083: incomingTxnContexts.add(new Object[] { nodeID, txnIDs,
084: Boolean.valueOf(relayed) });
085: incomingTxns.addAll(txns);
086: }
087:
088: public void transactionsRelayed(NodeID node, Set serverTxnIDs) {
089: throw new ImplementMe();
090: }
091:
092: public void commit(PersistenceTransactionProvider ptxp,
093: Collection objects, Map newRoots,
094: Collection appliedServerTransactionIDs) {
095: // NOP
096: }
097:
098: public void setResentTransactionIDs(NodeID source,
099: Collection transactionIDs) {
100: // NOP
101: }
102:
103: public void start(Set cids) {
104: // NOP
105: }
106:
107: public void goToActiveMode() {
108: throw new ImplementMe();
109: }
110:
111: public void callBackOnTxnsInSystemCompletion(
112: TxnsInSystemCompletionLister l) {
113: throw new ImplementMe();
114: }
115: }
|