ApplyTransactionContext.java :  » Net » Terracotta » com » tc » objectserver » context » Java Open Source

Java Open Source » Net » Terracotta 
Terracotta » com » tc » objectserver » context » ApplyTransactionContext.java
/*
 * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice.  All rights reserved.
 */
package com.tc.objectserver.context;

import com.tc.async.api.EventContext;
import com.tc.objectserver.tx.ServerTransaction;

import java.util.Collections;
import java.util.Map;

public class ApplyTransactionContext implements EventContext {

  private final ServerTransaction txn;
  private final Map objects;
  private final boolean needsApply;

  public ApplyTransactionContext(ServerTransaction txn, Map objects) {
    this.txn = txn;
    this.objects = objects;
    this.needsApply = true;
  }
  
  public ApplyTransactionContext(ServerTransaction txn) {
    this.txn = txn;
    this.objects = Collections.EMPTY_MAP;
    this.needsApply = false;
  }

  public Map getObjects() {
    return objects;
  }

  public ServerTransaction getTxn() {
    return txn;
  }

  public boolean needsApply() {
    return needsApply;
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.