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.objectserver.tx.ServerTransaction;
08:
09: import java.util.Collections;
10: import java.util.Map;
11:
12: public class ApplyTransactionContext implements EventContext {
13:
14: private final ServerTransaction txn;
15: private final Map objects;
16: private final boolean needsApply;
17:
18: public ApplyTransactionContext(ServerTransaction txn, Map objects) {
19: this .txn = txn;
20: this .objects = objects;
21: this .needsApply = true;
22: }
23:
24: public ApplyTransactionContext(ServerTransaction txn) {
25: this .txn = txn;
26: this .objects = Collections.EMPTY_MAP;
27: this .needsApply = false;
28: }
29:
30: public Map getObjects() {
31: return objects;
32: }
33:
34: public ServerTransaction getTxn() {
35: return txn;
36: }
37:
38: public boolean needsApply() {
39: return needsApply;
40: }
41:
42: }
|