KickJava   Java API By Example, From Geeks To Geeks.

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


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

5 package com.tc.objectserver.tx;
6
7 import com.tc.l2.msg.RelayedCommitTransactionMessage;
8 import com.tc.object.msg.CommitTransactionMessage;
9
10 import java.io.IOException JavaDoc;
11 import java.util.Collections JavaDoc;
12 import java.util.HashSet JavaDoc;
13
14 public final class CommitTransactionMessageToTransactionBatchReader implements TransactionBatchReaderFactory {
15
16   // Used by active server
17
public TransactionBatchReader newTransactionBatchReader(CommitTransactionMessage ctm) throws IOException JavaDoc {
18     return new TransactionBatchReaderImpl(ctm.getBatchData(), ctm.getChannelID(), ctm
19         .addAcknowledgedTransactionIDsTo(new HashSet JavaDoc()), ctm.getSerializer(), false);
20   }
21
22   // Used by passive server
23
public TransactionBatchReader newTransactionBatchReader(RelayedCommitTransactionMessage ctm) throws IOException JavaDoc {
24     return new TransactionBatchReaderImpl(ctm.getBatchData(), ctm.getChannelID(), Collections.EMPTY_LIST, ctm
25         .getSerializer(), true);
26   }
27
28 }
Popular Tags