KickJava   Java API By Example, From Geeks To Geeks.

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


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

4 package com.tc.objectserver.context;
5
6 import com.tc.async.api.EventContext;
7 import com.tc.net.protocol.tcm.ChannelID;
8 import com.tc.object.dmi.DmiDescriptor;
9 import com.tc.object.dna.impl.ObjectStringSerializer;
10 import com.tc.object.gtx.GlobalTransactionID;
11 import com.tc.object.lockmanager.api.LockID;
12 import com.tc.object.tx.TransactionID;
13 import com.tc.object.tx.TxnBatchID;
14 import com.tc.object.tx.TxnType;
15 import com.tc.objectserver.lockmanager.api.NotifiedWaiters;
16 import com.tc.objectserver.managedobject.BackReferences;
17 import com.tc.objectserver.tx.ServerTransaction;
18
19 import java.util.List JavaDoc;
20 import java.util.Map JavaDoc;
21
22 /**
23  * Context need to broadcast the transaction to the interested nodes
24  *
25  * @author steve
26  */

27 public class BroadcastChangeContext implements EventContext {
28   private final ServerTransaction tx;
29   private final GlobalTransactionID gtxID;
30   private final GlobalTransactionID lowGlobalTransactionIDWatermark;
31   private final NotifiedWaiters notifiedWaiters;
32   private final BackReferences includeIDs;
33
34   public BroadcastChangeContext(GlobalTransactionID gtxID, ServerTransaction tx,
35                                 GlobalTransactionID lowGlobalTransactionIDWatermark, NotifiedWaiters notifiedWaiters,
36                                 BackReferences includeIDs) {
37     this.gtxID = gtxID;
38     this.tx = tx;
39     this.lowGlobalTransactionIDWatermark = lowGlobalTransactionIDWatermark;
40     this.notifiedWaiters = notifiedWaiters;
41     this.includeIDs = includeIDs;
42   }
43
44   public BackReferences getIncludeIDs() {
45     return includeIDs;
46   }
47
48   public List JavaDoc getChanges() {
49     return tx.getChanges();
50   }
51
52   public LockID[] getLockIDs() {
53     return tx.getLockIDs();
54   }
55
56   public ChannelID getChannelID() {
57     return tx.getChannelID();
58   }
59
60   public TransactionID getTransactionID() {
61     return tx.getTransactionID();
62   }
63   
64   public TxnBatchID getBatchID() {
65     return tx.getBatchID();
66   }
67
68   public TxnType getTransactionType() {
69     return tx.getTransactionType();
70   }
71
72   public GlobalTransactionID getGlobalTransactionID() {
73     return gtxID;
74   }
75
76   public GlobalTransactionID getLowGlobalTransactionIDWatermark() {
77     return this.lowGlobalTransactionIDWatermark;
78   }
79
80   public ObjectStringSerializer getSerializer() {
81     return tx.getSerializer();
82   }
83
84   public NotifiedWaiters getNewlyPendingWaiters() {
85     return notifiedWaiters;
86   }
87   
88   public Map JavaDoc getNewRoots() {
89     return tx.getNewRoots();
90   }
91   
92   public DmiDescriptor[] getDmiDescriptors() {
93     return tx.getDmiDescriptors();
94   }
95
96 }
97
Popular Tags