KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > context > CommitTransactionContext


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.context;
6
7 import com.tc.async.api.EventContext;
8 import com.tc.util.Assert;
9
10 import java.util.Collection JavaDoc;
11 import java.util.Map JavaDoc;
12 import java.util.Set JavaDoc;
13
14 public class CommitTransactionContext implements EventContext {
15
16   private Collection JavaDoc txnIDs;
17   private Collection JavaDoc objects;
18   private Set JavaDoc completedTxnIds;
19   private Map JavaDoc newRoots;
20   private boolean isInitialized = false;
21
22   public CommitTransactionContext() {
23     // Empty constructor
24
}
25
26   public void initialize(Collection JavaDoc appliedTxnIDs, Collection JavaDoc appliedObjects, Map JavaDoc newRootsInAppliedTxns,
27                          Set JavaDoc completedTransactionIDs) {
28     this.txnIDs = appliedTxnIDs;
29     this.objects = appliedObjects;
30     this.newRoots = newRootsInAppliedTxns;
31     this.completedTxnIds = completedTransactionIDs;
32     isInitialized = true;
33   }
34
35   public boolean isInitialized() {
36     return isInitialized;
37   }
38
39   public Set JavaDoc getCompletedTransactionIDs() {
40     Assert.assertNotNull(completedTxnIds);
41     return completedTxnIds;
42   }
43
44   public Collection JavaDoc getObjects() {
45     return objects;
46   }
47
48   public Collection JavaDoc getAppliedServerTransactionIDs() {
49     return txnIDs;
50   }
51
52   public Map JavaDoc getNewRoots() {
53     return newRoots;
54   }
55
56 }
57
Popular Tags