Package com.opengamma.engine.view

Examples of com.opengamma.engine.view.ViewProcessor


    jmsConnectorFactoryBean.setName("Masters");

    JmsConnector jmsConnector = jmsConnectorFactoryBean.getObjectCreating();
    ScheduledExecutorService heartbeatScheduler = Executors.newSingleThreadScheduledExecutor();
    try {
      ViewProcessor vp = new RemoteViewProcessor(
          vpBase,
          jmsConnector,
          heartbeatScheduler);
      ViewClient vc = vp.createViewClient(UserPrincipal.getLocalUser());

      HistoricalMarketDataSpecification marketDataSpecification = MarketData.historical(observationDate, null);

      ViewExecutionOptions executionOptions = ExecutionOptions.batch(valuationTime, marketDataSpecification, null);
View Full Code Here


    System.exit(0);
  }

  @Override
  protected void doRun() throws Exception {
    ViewProcessor viewProcessor = getToolContext().getViewProcessor();
    ConfigSource configSource = getToolContext().getConfigSource();
    String viewDefName = getCommandLine().getOptionValue(VIEW_DEF_NAME_OPTION);
    boolean batchMode = getCommandLine().hasOption(BATCH_MODE_OPTION);
    ViewResultListener listener;
    if (getCommandLine().hasOption(RESULT_LISTENER_CLASS_OPTION)) {
View Full Code Here

   *
   * @param repo the repository to register with, not null
   * @param appContext the Spring application context, not null
   */
  protected void initViewProcessor(final ComponentRepository repo, final GenericApplicationContext appContext) {
    final ViewProcessor viewProcessor = appContext.getBean(ViewProcessor.class);
    final ComponentInfo info = new ComponentInfo(ViewProcessor.class, getClassifier());
    if (getJmsBrokerUri() != null) {
      info.addAttribute(ComponentInfoAttributes.JMS_BROKER_URI, getJmsBrokerUri());
    }
    repo.registerComponent(info, viewProcessor);
View Full Code Here

    //No need to do any work if there are no ValueRequirements to compute
    if (_valueRequirementNames.isEmpty()) {
      return statusResult;
    }
    final ViewDefinition viewDefinition = createViewDefinition();
    final ViewProcessor viewProcessor = _toolContext.getViewProcessor();
    final ViewClient client = viewProcessor.createViewClient(_user);

    final CountDownLatch latch = new CountDownLatch(1);
    client.setResultListener(new ViewStatusResultListener(latch, statusResult, viewDefinition));
    client.attachToViewProcess(viewDefinition.getUniqueId(), ExecutionOptions.infinite(_marketDataSpecification));
  
View Full Code Here

  @Override
  public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target,
      final Set<ValueRequirement> desiredValues) throws AsynchronousExecution {
    final ViewEvaluationTarget viewEvaluation = (ViewEvaluationTarget) target.getValue();
    final UniqueId viewId = storeViewDefinition(executionContext, target.getUniqueId(), viewEvaluation.getViewDefinition());
    final ViewProcessor viewProcessor = OpenGammaExecutionContext.getViewProcessor(executionContext);
    if (viewProcessor == null) {
      throw new IllegalStateException("Execution context does not contain a " + OpenGammaExecutionContext.VIEW_PROCESSOR_NAME);
    }
    final ViewClient viewClient = viewProcessor.createViewClient(viewEvaluation.getViewDefinition().getMarketDataUser());
    final UniqueId viewClientId = viewClient.getUniqueId();
    s_logger.info("Created view client {}, connecting to {}", viewClientId, viewId);
    viewClient.attachToViewProcess(viewId,
        ExecutionOptions.of(viewEvaluation.getExecutionSequence().createSequence(executionContext), getDefaultCycleOptions(executionContext), getViewExecutionFlags(desiredValues)), true);
    final TResultBuilder resultBuilder = createResultBuilder(viewEvaluation, desiredValues);
View Full Code Here

    factory.setName("WatchListRecorder");
    factory.setConnectionFactory(cf);
    factory.setClientBrokerUri(uri);
    final JmsConnector jmsConnector = factory.getObjectCreating();

    final ViewProcessor viewProcessor = new RemoteViewProcessor(viewProcessorInfo.getUri(), jmsConnector, Executors.newSingleThreadScheduledExecutor());
    // TODO: Not ideal; the published resolver should be used rather than an ad-hoc one created based just on the security source
    final ComputationTargetResolver targetResolver = new DefaultComputationTargetResolver(new RemoteSecuritySource(securitySourceInfo.getUri()));
    return new WatchListRecorder(viewProcessor, targetResolver);
  }
View Full Code Here

    ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(uri);
    JmsConnectorFactoryBean factory = new JmsConnectorFactoryBean();
    factory.setName(getClass().getSimpleName());
    factory.setConnectionFactory(cf);
    factory.setClientBrokerUri(uri);
    ViewProcessor vp = new RemoteViewProcessor(vpBase, factory.getObjectCreating(), Executors.newSingleThreadScheduledExecutor());
    startViewer(vp);
  }
View Full Code Here

    try {
      appContext = getApplicationContext();
      appContext.start();

      ViewProcessor viewProcessor = appContext.getBean("viewProcessor", ViewProcessor.class);

      ViewClient viewClient = viewProcessor.createViewClient(UserPrincipal.getLocalUser());
      MarketDataSpecification marketDataSpec = new FixedHistoricalMarketDataSpecification(s_observationDateTime.toLocalDate());
      ViewCycleExecutionOptions cycleOptions = ViewCycleExecutionOptions.builder().setValuationTime(s_valuationInstant).setMarketDataSpecification(marketDataSpec)
          .setResolverVersionCorrection(VersionCorrection.of(s_versionAsOf, s_correctedTo)).create();
      ViewCycleExecutionSequence executionSequence = ArbitraryViewCycleExecutionSequence.of(cycleOptions);
View Full Code Here

            continue;
          }
          if (ViewProcessor.class.equals(componentInfo.getType())) {
            final JmsConnector jmsConnector = createJmsConnector(componentInfo);
            final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("rvp"));
            ViewProcessor vp = new RemoteViewProcessor(componentInfo.getUri(), jmsConnector, scheduler);
            toolContext.setViewProcessor(vp);
            toolContext.setContextManager(new Closeable() {
              @Override
              public void close() throws IOException {
                scheduler.shutdownNow();
View Full Code Here

  //-------------------------------------------------------------------------
  @Override
  protected void initComponent(ComponentRepository repo, ComponentInfo info) {
    if (ViewProcessor.class.isAssignableFrom(info.getType())) {
      ViewProcessor viewProcessor = new RemoteViewProcessor(info.getUri(), _jmsConnector, Executors.newSingleThreadScheduledExecutor());
      repo.registerComponent(info, viewProcessor);
      if (isPublishRest()) {
        repo.getRestComponents().republish(info);
      }
    }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.view.ViewProcessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.