Package com.opengamma.engine.function

Examples of com.opengamma.engine.function.CompiledFunctionService$StaticFunctionRepository


    final InMemoryFunctionRepository functionRepo = new InMemoryFunctionRepository();
    final FunctionCompilationContext functionCompilationContext = new FunctionCompilationContext();
    functionCompilationContext.setFunctionInitId(123);
    functionCompilationContext.setRawComputationTargetResolver(new DefaultCachingComputationTargetResolver(new DefaultComputationTargetResolver(securitySource, positionSource),
        _cacheManager));
    final CompiledFunctionService cfs = new CompiledFunctionService(functionRepo, new CachingFunctionRepositoryCompiler(), functionCompilationContext);
    cfs.initialize();
    final DefaultFunctionResolver functionResolver = new DefaultFunctionResolver(cfs);
    final ViewCompilationServices vcs = new ViewCompilationServices(new FixedMarketDataAvailabilityProvider(), functionResolver, functionCompilationContext, new PoolExecutor(1, getClass()
        .getSimpleName()),
        new DependencyGraphBuilderFactory());
    final ViewDefinition viewDefinition = new ViewDefinition("My View", UniqueId.of("FOO", "BAR"), "kirk");
View Full Code Here


    final InMemoryFunctionRepository functionRepo = new InMemoryFunctionRepository();
    functionRepo.addFunction(fn1);
    final FunctionCompilationContext functionCompilationContext = new FunctionCompilationContext();
    functionCompilationContext.setFunctionInitId(123);
    functionCompilationContext.setSecuritySource(securitySource);
    final CompiledFunctionService cfs = new CompiledFunctionService(functionRepo, new CachingFunctionRepositoryCompiler(), functionCompilationContext);
    cfs.initialize();
    final DefaultFunctionResolver functionResolver = new DefaultFunctionResolver(cfs);
    final DefaultCachingComputationTargetResolver computationTargetResolver = new DefaultCachingComputationTargetResolver(new DefaultComputationTargetResolver(securitySource, positionSource),
        _cacheManager);
    functionCompilationContext.setRawComputationTargetResolver(computationTargetResolver);
    final ViewCompilationServices vcs = new ViewCompilationServices(new FixedMarketDataAvailabilityProvider(), functionResolver, functionCompilationContext, new PoolExecutor(1, getClass()
View Full Code Here

    final InMemoryFunctionRepository functionRepo = new InMemoryFunctionRepository();
    functionRepo.addFunction(fn1);
    functionRepo.addFunction(fn2);
    final FunctionCompilationContext functionCompilationContext = new FunctionCompilationContext();
    functionCompilationContext.setFunctionInitId(123);
    final CompiledFunctionService cfs = new CompiledFunctionService(functionRepo, new CachingFunctionRepositoryCompiler(), functionCompilationContext);
    cfs.initialize();
    final DefaultFunctionResolver functionResolver = new DefaultFunctionResolver(cfs);
    final DefaultCachingComputationTargetResolver computationTargetResolver = new DefaultCachingComputationTargetResolver(new DefaultComputationTargetResolver(securitySource, positionSource),
        _cacheManager);
    functionCompilationContext.setRawComputationTargetResolver(computationTargetResolver);
    final ViewCompilationServices vcs = new ViewCompilationServices(new FixedMarketDataAvailabilityProvider(), functionResolver, functionCompilationContext, new PoolExecutor(1, getClass()
View Full Code Here

    final InMemoryFunctionRepository functionRepo = new InMemoryFunctionRepository();
    final MockFunction f1 = MockFunction.getMockFunction(new ComputationTarget(ComputationTargetType.PRIMITIVE, t1), 42);
    functionRepo.addFunction(f1);
    final FunctionCompilationContext compilationContext = new FunctionCompilationContext();
    compilationContext.setFunctionInitId(123);
    final CompiledFunctionService cfs = new CompiledFunctionService(functionRepo, new CachingFunctionRepositoryCompiler(), compilationContext);
    cfs.initialize();
    final DefaultFunctionResolver functionResolver = new DefaultFunctionResolver(cfs);
    final DefaultCachingComputationTargetResolver computationTargetResolver = new DefaultCachingComputationTargetResolver(new DefaultComputationTargetResolver(), _cacheManager);
    compilationContext.setRawComputationTargetResolver(computationTargetResolver);
    final ViewCompilationServices compilationServices = new ViewCompilationServices(new FixedMarketDataAvailabilityProvider(), functionResolver, compilationContext, new PoolExecutor(1, getClass()
        .getSimpleName()),
View Full Code Here

    final MockFunction f2 = MockFunction.getMockFunction("f2", new ComputationTarget(ComputationTargetType.SECURITY, sec1), 60, f1);
    functionRepo.addFunction(f1);
    functionRepo.addFunction(f2);
    final FunctionCompilationContext compilationContext = new FunctionCompilationContext();
    compilationContext.setFunctionInitId(123);
    final CompiledFunctionService cfs = new CompiledFunctionService(functionRepo, new CachingFunctionRepositoryCompiler(), compilationContext);
    cfs.initialize();
    final DefaultFunctionResolver functionResolver = new DefaultFunctionResolver(cfs);
    final DefaultCachingComputationTargetResolver computationTargetResolver = new DefaultCachingComputationTargetResolver(new DefaultComputationTargetResolver(securitySource), _cacheManager);
    compilationContext.setRawComputationTargetResolver(computationTargetResolver);
    final ViewCompilationServices compilationServices = new ViewCompilationServices(new FixedMarketDataAvailabilityProvider(), functionResolver, compilationContext, new PoolExecutor(1, getClass()
        .getSimpleName()),
View Full Code Here

    final ViewDefinition viewDefinition = new ViewDefinition("Test", "jonathan");
    final ViewCalculationConfiguration calcConfig = new ViewCalculationConfiguration(viewDefinition, "Config1");
    viewDefinition.addViewCalculationConfiguration(calcConfig);
    final FunctionRepository functionRepo = new InMemoryFunctionRepository();
    final FunctionCompilationContext compilationContext = new FunctionCompilationContext();
    final CompiledFunctionService cfs = new CompiledFunctionService(functionRepo, new CachingFunctionRepositoryCompiler(), compilationContext);
    cfs.initialize();
    final DefaultFunctionResolver functionResolver = new DefaultFunctionResolver(cfs);
    final SecuritySource securitySource = new InMemorySecuritySource();
    final DefaultCachingComputationTargetResolver computationTargetResolver = new DefaultCachingComputationTargetResolver(new DefaultComputationTargetResolver(securitySource),
        _cacheManager);
    compilationContext.setRawComputationTargetResolver(computationTargetResolver);
View Full Code Here

        return super.execute(executionContext, inputs, target, desiredValues);
      }
    };
    functionRepository.addFunction(mockFunction);
    final FunctionCompilationContext compilationContext = new FunctionCompilationContext();
    final CompiledFunctionService compilationService = new CompiledFunctionService(functionRepository, new CachingFunctionRepositoryCompiler(), compilationContext);
    compilationService.initialize();
    final FunctionResolver functionResolver = new DefaultFunctionResolver(compilationService);
    final InMemorySecuritySource securitySource = new InMemorySecuritySource();
    final MockPositionSource positionSource = new MockPositionSource();
    compilationContext.setRawComputationTargetResolver(new DefaultComputationTargetResolver(securitySource, positionSource));
    final ViewComputationCacheSource computationCacheSource = new InMemoryViewComputationCacheSource(FudgeContext.GLOBAL_DEFAULT);
View Full Code Here

      }
    }
    assertNotNull(definition);
    final FunctionCompilationContext context = new FunctionCompilationContext();
    context.setRawComputationTargetResolver(new DefaultComputationTargetResolver());
    final CompiledFunctionService cfs = new CompiledFunctionService(repo, new CachingFunctionRepositoryCompiler(), context);
    cfs.initialize();
    final CompiledFunctionRepository compiledRepo = cfs.compileFunctionRepository(System.currentTimeMillis());
    assertNotNull(compiledRepo.getDefinition(definition.getUniqueId()));
    final FunctionInvoker invoker = compiledRepo.getInvoker(definition.getUniqueId());
    assertNotNull(invoker);
    assertTrue(invoker instanceof MockEmptyFunction);
    assertSame(definition, invoker);
View Full Code Here

      final ChangeManager changeManager = new BasicChangeManager();
      final ComputationTargetResolver targetResolver = Mockito.mock(ComputationTargetResolver.class);
      Mockito.when(targetResolver.changeManager()).thenReturn(changeManager);
      final FunctionCompilationContext ctx = new FunctionCompilationContext();
      ctx.setRawComputationTargetResolver(targetResolver);
      final CompiledFunctionService cfs = Mockito.mock(CompiledFunctionService.class);
      Mockito.when(cfs.getFunctionCompilationContext()).thenReturn(ctx);
      final ViewProcessContext vpContext = Mockito.mock(ViewProcessContext.class);
      Mockito.when(vpContext.getFunctionCompilationService()).thenReturn(cfs);
      final MockContext context = new MockContext(vpContext);
      final ViewExecutionOptions options = ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().ignoreCompilationValidity().get());
      final ViewDefinition viewDefinition = Mockito.mock(ViewDefinition.class);
View Full Code Here

   *
   * @param repo the repository to register with, not null
   * @param appContext the Spring application context, not null
   */
  protected void initFunctions(final ComponentRepository repo, final GenericApplicationContext appContext) {
    final CompiledFunctionService compiledFunctionService = appContext.getBean(CompiledFunctionService.class);
    final ComponentInfo infoCFS = new ComponentInfo(CompiledFunctionService.class, getClassifier());
    repo.registerComponent(infoCFS, compiledFunctionService);
    final ComponentInfo infoFR = new ComponentInfo(FunctionRepository.class, getClassifier());
    repo.registerComponent(infoFR, compiledFunctionService.getFunctionRepository());
    final FunctionExclusionGroups functionExclusionGroups = appContext.getBean(FunctionExclusionGroups.class);
    repo.registerComponent(new ComponentInfo(FunctionExclusionGroups.class, getClassifier()), functionExclusionGroups);
    final FunctionResolver functionResolver = appContext.getBean(FunctionResolver.class);
    repo.registerComponent(new ComponentInfo(FunctionResolver.class, getClassifier()), functionResolver);
    if (isPublishRest()) {
      repo.getRestComponents().publishResource(new DataFunctionRepositoryResource(compiledFunctionService.getFunctionRepository()));
    }
  }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.function.CompiledFunctionService$StaticFunctionRepository

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.