1 4 package com.tc.objectserver.tx; 5 6 import EDU.oswego.cs.dl.util.concurrent.LinkedQueue; 7 import EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean; 8 9 import com.tc.exception.TCRuntimeException; 10 import com.tc.net.protocol.tcm.ChannelID; 11 import com.tc.object.tx.TransactionID; 12 import com.tc.object.tx.TxnBatchID; 13 import com.tc.util.concurrent.NoExceptionLinkedQueue; 14 15 public final class TestTransactionBatchManager implements TransactionBatchManager { 16 17 public final LinkedQueue defineBatchContexts = new LinkedQueue(); 18 19 public void defineBatch(ChannelID channelID, TxnBatchID batchID, int count) { 20 Object [] args = new Object [] { channelID, batchID, new Integer (count) }; 21 try { 22 defineBatchContexts.put(args); 23 } catch (InterruptedException e) { 24 throw new TCRuntimeException(e); 25 } 26 } 27 28 public final NoExceptionLinkedQueue batchComponentCompleteCalls = new NoExceptionLinkedQueue(); 29 public final SynchronizedBoolean isBatchComponentComplete = new SynchronizedBoolean(false); 30 31 public boolean batchComponentComplete(ChannelID channelID, TxnBatchID batchID, TransactionID txnID) { 32 batchComponentCompleteCalls.put(new Object [] {channelID, batchID, txnID }); 33 return isBatchComponentComplete.get(); 34 } 35 36 public final NoExceptionLinkedQueue shutdownClientCalls = new NoExceptionLinkedQueue(); 37 public void shutdownClient(ChannelID channelID) { 38 shutdownClientCalls.put(channelID); 39 } 40 41 } | Popular Tags |