Package com.opengamma.core.change

Examples of com.opengamma.core.change.BasicChangeManager


   * Creates an instance.
   *
   * @param baseUri the base target URI for all RESTful web services, not null
   */
  public RemoteCurrencyMatrixSource(final URI baseUri) {
    this(baseUri, new BasicChangeManager());
  }
View Full Code Here


  }

  @BeforeMethod
  public void setUp() {
    _underlyingSource = mock(HistoricalTimeSeriesSource.class);
    when(_underlyingSource.changeManager()).thenReturn(new BasicChangeManager());
    _cachingSource = new EHCachingHistoricalTimeSeriesSource(_underlyingSource, _cacheManager);
  }
View Full Code Here

  protected void testImpl(final Function2<ParallelRecompilationViewProcessWorker, ViewExecutionOptions, Void> callback) throws InterruptedException {
    final ExecutorService executor = Executors.newCachedThreadPool();
    try {
      final Map<ComputationTargetReference, UniqueId> resolutions = new HashMap<ComputationTargetReference, UniqueId>();
      resolutions.put(new ComputationTargetSpecification(ComputationTargetType.PORTFOLIO, UniqueId.of("Test", "0")), UniqueId.of("Test", "0", "0"));
      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);
      final ParallelRecompilationViewProcessWorker worker = new ParallelRecompilationViewProcessWorker(workerFactory(executor, resolutions), context, options, viewDefinition);
      callback.execute(worker, options);
      s_logger.debug("Waiting for initial compilation");
      assertEquals(context.event(), "view definition compiled"); // From primary worker
      for (int j = 0; j < 5; j++) {
        // Expect a sequence of operations
        for (int i = 0; i < 3; i++) {
          s_logger.debug("Waiting for cycle to start");
          assertEquals(context.event(), "cycle started"); // From primary worker
          s_logger.info("Cycle started");
          assertEquals(context.event(), "cycle fragment completed");
          s_logger.info("Cycle fragment completed");
          assertEquals(context.event(), "cycle completed");
          s_logger.info("Cycle completed");
        }
        // Signal change ...
        s_logger.debug("Signalling change");
        resolutions.put(new ComputationTargetSpecification(ComputationTargetType.PORTFOLIO, UniqueId.of("Test", "0")), UniqueId.of("Test", "0", Integer.toString(j + 1)));
        changeManager.entityChanged(ChangeType.CHANGED, ObjectId.of("Test", "0"), Instant.now(), Instant.now(), Instant.now());
        s_logger.info("Change signalled");
        // ... and expect a view definition compiled to interrupt the sequence
        String event = context.event();
        for (int i = 0; i < 20; i++) {
          if (event.equals("cycle started")) {
View Full Code Here

    EHCacheUtils.addCache(cacheManager, ID_BUNDLE_CACHE_NAME);
    _identifierBundleCache = EHCacheUtils.getCacheFromManager(cacheManager, ID_BUNDLE_CACHE_NAME);

    _changeListener = createChangeListener();
    _underlying.changeManager().addChangeListener(_changeListener);
    _changeManager = new BasicChangeManager();
  }
View Full Code Here

   * Creates an instance.
   *
   * @param baseUri  the base target URI for all RESTful web services, not null
   */
  public RemotePositionSource(final URI baseUri) {
    this(baseUri, new BasicChangeManager());
  }
View Full Code Here

   *
   * @param baseUri  the base target URI for all RESTful web services, not null
   */
  public RemoteConfigSource(final URI baseUri) {
    super(baseUri);
    _changeManager = new BasicChangeManager();
  }
View Full Code Here

   * Creates an instance.
   *
   * @param baseUri the base target URI for all RESTful web services, not null
   */
  public RemoteOrganizationSource(URI baseUri) {
    this(baseUri, new BasicChangeManager());
  }
View Full Code Here

    return null;
  }

  @Override
  public ChangeManager changeManager() {
    return new BasicChangeManager();
  }
View Full Code Here

   * Creates an instance.
   *
   * @param baseUri  the base target URI for all RESTful web services, not null
   */
  public RemoteHistoricalTimeSeriesSource(final URI baseUri) {
    this(baseUri, new BasicChangeManager());
  }
View Full Code Here

   * Creates an instance specifying the supplier of object identifiers.
   *
   * @param objectIdSupplier  the supplier of object identifiers, not null
   */
  public InMemoryPortfolioMaster(final Supplier<ObjectId> objectIdSupplier) {
    this(objectIdSupplier, new BasicChangeManager());
  }
View Full Code Here

TOP

Related Classes of com.opengamma.core.change.BasicChangeManager

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.