01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.objectserver.context;
05:
06: import com.tc.async.api.EventContext;
07: import com.tc.net.groups.NodeID;
08: import com.tc.object.dmi.DmiDescriptor;
09: 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;
20: import java.util.Map;
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 lowGlobalTransactionIDWatermark;
30: private final NotifiedWaiters notifiedWaiters;
31: private final BackReferences includeIDs;
32:
33: public BroadcastChangeContext(ServerTransaction tx,
34: GlobalTransactionID lowGlobalTransactionIDWatermark,
35: NotifiedWaiters notifiedWaiters, BackReferences includeIDs) {
36: this .tx = tx;
37: this .lowGlobalTransactionIDWatermark = lowGlobalTransactionIDWatermark;
38: this .notifiedWaiters = notifiedWaiters;
39: this .includeIDs = includeIDs;
40: }
41:
42: public BackReferences getIncludeIDs() {
43: return includeIDs;
44: }
45:
46: public List getChanges() {
47: return tx.getChanges();
48: }
49:
50: public LockID[] getLockIDs() {
51: return tx.getLockIDs();
52: }
53:
54: public NodeID getNodeID() {
55: return tx.getSourceID();
56: }
57:
58: public TransactionID getTransactionID() {
59: return tx.getTransactionID();
60: }
61:
62: public TxnBatchID getBatchID() {
63: return tx.getBatchID();
64: }
65:
66: public TxnType getTransactionType() {
67: return tx.getTransactionType();
68: }
69:
70: public GlobalTransactionID getGlobalTransactionID() {
71: return tx.getGlobalTransactionID();
72: }
73:
74: public GlobalTransactionID getLowGlobalTransactionIDWatermark() {
75: return this .lowGlobalTransactionIDWatermark;
76: }
77:
78: public ObjectStringSerializer getSerializer() {
79: return tx.getSerializer();
80: }
81:
82: public NotifiedWaiters getNewlyPendingWaiters() {
83: return notifiedWaiters;
84: }
85:
86: public Map getNewRoots() {
87: return tx.getNewRoots();
88: }
89:
90: public DmiDescriptor[] getDmiDescriptors() {
91: return tx.getDmiDescriptors();
92: }
93:
94: }
|