/**
 * Copyright (C) 2009 - 2009 by OpenGamma Inc.
 *
 * Please see distribution for license.
 */
package com.opengamma.engine.function;

import javax.time.calendar.Clock;

import com.opengamma.engine.historicaldata.HistoricalDataProvider;
import com.opengamma.engine.security.SecurityMaster;
import com.opengamma.engine.view.calcnode.ViewProcessorQuery;

/**
 * Holds values that will be provided to a {@link FunctionInvoker} during invocation.
 *
 */
public class FunctionExecutionContext extends AbstractFunctionContext {
  /**
   * The name under which an instance of {@link HistoricalDataProvider} should be bound.
   */
  public static final String HISTORICAL_DATA_PROVIDER_NAME = "historicalDataProvider";
  /**
   * The name under which an instance of {@link SecurityMaster} should be bound.
   */
  public static final String SECURITY_MASTER_NAME = "securityMaster";
  /**
   * The name under which an instance of {@link ViewProcessor} should be bound.
   */
  public static final String VIEW_PROCESSOR_QUERY_NAME = "viewProcessorQuery";
  /**
   * The name under which the epoch time indicating the snapshot time will be bound.
   */
  public static final String SNAPSHOT_EPOCH_TIME_NAME = "snapshotEpochTime";
  /**
   * The name under which a JSR-310 Clock providing the snapshot time will be bound.
   */
  public static final String SNAPSHOT_CLOCK_NAME = "snapshotClock";

  public HistoricalDataProvider getHistoricalDataProvider() {
    return (HistoricalDataProvider) get(HISTORICAL_DATA_PROVIDER_NAME);
  }
  
  public void setHistoricalDataProvider(HistoricalDataProvider historicalDataProvider) {
    put(HISTORICAL_DATA_PROVIDER_NAME, historicalDataProvider);
  }
  
  public SecurityMaster getSecurityMaster() {
    return (SecurityMaster) get(SECURITY_MASTER_NAME);
  }
  
  public void setSecurityMaster(SecurityMaster secMaster) {
    put(SECURITY_MASTER_NAME, secMaster);
  }
  
  public ViewProcessorQuery getViewProcessorQuery() {
    return (ViewProcessorQuery) get(VIEW_PROCESSOR_QUERY_NAME);
  }
  
  public void setViewProcessorQuery(ViewProcessorQuery viewProcessorQuery) {
    put(VIEW_PROCESSOR_QUERY_NAME, viewProcessorQuery);
  }
  
  public Long getSnapshotEpochTime() {
    return (Long) get(SNAPSHOT_EPOCH_TIME_NAME);
  }
  
  public void setSnapshotEpochTime(Long snapshotEpochTime) {
    put(SNAPSHOT_EPOCH_TIME_NAME, snapshotEpochTime);
  }

  public Clock getSnapshotClock() {
    return (Clock) get(SNAPSHOT_CLOCK_NAME);
  }
  
  public void setSnapshotClock(Clock snapshotClock) {
    put(SNAPSHOT_CLOCK_NAME, snapshotClock);
  }
}

@@ -528,359 +528,8 @@
 /**%0A
-   * The name under which an instance of %7B@link HistoricalDataProvider%7D should be bound.%0A   */%0A  public static final String HISTORICAL_DATA_PROVIDER_NAME = %22historicalDataProvider%22;%0A  /**%0A   * The name under which an instance of %7B@link SecurityMaster%7D should be bound.%0A   */%0A  public static final String SECURITY_MASTER_NAME = %22securityMaster%22;%0A  /**%0A
    *
@@ -1033,526 +1033,8 @@
 %22;%0A%0A
-  public HistoricalDataProvider getHistoricalDataProvider() %7B%0A    return (HistoricalDataProvider) get(HISTORICAL_DATA_PROVIDER_NAME);%0A  %7D%0A  %0A  public void setHistoricalDataProvider(HistoricalDataProvider historicalDataProvider) %7B%0A    put(HISTORICAL_DATA_PROVIDER_NAME, historicalDataProvider);%0A  %7D%0A  %0A  public SecurityMaster getSecurityMaster() %7B%0A    return (SecurityMaster) get(SECURITY_MASTER_NAME);%0A  %7D%0A  %0A  public void setSecurityMaster(SecurityMaster secMaster) %7B%0A    put(SECURITY_MASTER_NAME, secMaster);%0A  %7D%0A  %0A
   pu

Create OpenGammaExecutionContext