1 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 ; 11 import java.util.Map ; 12 import java.util.Set ; 13 14 public class CommitTransactionContext implements EventContext { 15 16 private Collection txnIDs; 17 private Collection objects; 18 private Set completedTxnIds; 19 private Map newRoots; 20 private boolean isInitialized = false; 21 22 public CommitTransactionContext() { 23 } 25 26 public void initialize(Collection appliedTxnIDs, Collection appliedObjects, Map newRootsInAppliedTxns, 27 Set 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 getCompletedTransactionIDs() { 40 Assert.assertNotNull(completedTxnIds); 41 return completedTxnIds; 42 } 43 44 public Collection getObjects() { 45 return objects; 46 } 47 48 public Collection getAppliedServerTransactionIDs() { 49 return txnIDs; 50 } 51 52 public Map getNewRoots() { 53 return newRoots; 54 } 55 56 } 57 | Popular Tags |