Package com.opengamma.core.change

Examples of com.opengamma.core.change.ChangeProvider


      if (!_isRunning) {
        _changeLock.lock();
        try {
          final Instant now = Instant.now();
          for (Map.Entry<ChangeProvider, VersionedSource> entry : _masterToSource.entrySet()) {
            final ChangeProvider master = entry.getKey();
            final VersionedSource source = entry.getValue();
            final ChangeListener listener = new ChangeListener() {
              @Override
              public void entityChanged(ChangeEvent event) {
                if (_watchSet.contains(event.getObjectId())) {
                  ViewProcessorManager.this.onMasterChanged(Instant.now(), source, event.getObjectId());
                }
              }
            };
            master.changeManager().addChangeListener(listener);
            _masterToListener.put(master, listener);
            s_logger.debug("Latching {} to {}", source, now);
            // TODO this isn't ideal if there is clock drift between nodes - the time needs to be the system time at the master
            source.setVersionCorrection(VersionCorrection.ofVersionAsOf(now)); // TODO ignores correction
          }
View Full Code Here


   * produces their events.
   */
  public MasterChangeManager(Map<MasterType, ChangeProvider> changeProviders) {
    for (Map.Entry<MasterType, ChangeProvider> entry : changeProviders.entrySet()) {
      final MasterType masterType = entry.getKey();
      ChangeProvider changeProvider = entry.getValue();
      changeProvider.changeManager().addChangeListener(new ChangeListener() {
        @Override
        public void entityChanged(ChangeEvent event) {
          MasterChangeManager.this.entityChanged(masterType);
        }
      });
View Full Code Here

TOP

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

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.