Package com.opengamma.component

Examples of com.opengamma.component.ComponentInfo


  private Integer _maxRetries;

  //-------------------------------------------------------------------------
  @Override
  public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) {
    ComponentInfo info = new ComponentInfo(MarketDataSnapshotMaster.class, getClassifier());
   
    // create
    DbMarketDataSnapshotMaster master = new DbMarketDataSnapshotMaster(getDbConnector());
    if (getUniqueIdScheme() != null) {
      master.setUniqueIdScheme(getUniqueIdScheme());
    }
    if (getMaxRetries() != null) {
      master.setMaxRetries(getMaxRetries());
    }
    if (getJmsChangeManagerTopic() != null) {
      JmsChangeManager cm = new JmsChangeManager(getJmsConnector(), getJmsChangeManagerTopic());
      master.setChangeManager(cm);
      repo.registerLifecycle(cm);
      if (getJmsConnector().getClientBrokerUri() != null) {
        info.addAttribute(ComponentInfoAttributes.JMS_BROKER_URI, getJmsConnector().getClientBrokerUri().toString());
      }
      info.addAttribute(ComponentInfoAttributes.JMS_CHANGE_MANAGER_TOPIC, getJmsChangeManagerTopic());
    }
    checkSchema(master.getSchemaVersion(), "snp");
   
    // register
    info.addAttribute(ComponentInfoAttributes.LEVEL, 1);
    info.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteMarketDataSnapshotMaster.class);
    info.addAttribute(ComponentInfoAttributes.UNIQUE_ID_SCHEME, master.getUniqueIdScheme());
    repo.registerComponent(info, master);
   
    // publish
    if (isPublishRest()) {
      repo.getRestComponents().publish(info, new DataMarketDataSnapshotMasterResource(master));
View Full Code Here


        classifier = conf.getValue();
      } else {
        try {
          if (conf.getValue().startsWith("::")) {
            final Class<?> property = PropertyUtils.getPropertyType(_bean, conf.getKey());
            final ComponentInfo info = repo.findInfo(property, conf.getValue().substring(2));
            if (info != null) {
              BeanUtils.setProperty(_bean, conf.getKey(), repo.getInstance(info));
            } else {
              BeanUtils.setProperty(_bean, conf.getKey(), conf.getValue());
            }
          } else {
            BeanUtils.setProperty(_bean, conf.getKey(), conf.getValue());
          }
        } catch (Exception e) {
          throw new OpenGammaRuntimeException("invalid property '" + conf.getKey() + "' on " + _bean, e);
        }
      }
      itr.remove();
    }
    final FunctionBlacklist blacklist = _bean.getObjectCreating();
   
    ComponentInfo infoRO = new ComponentInfo(FunctionBlacklist.class, classifier);
    infoRO.addAttribute(ComponentInfoAttributes.LEVEL, 1);
    infoRO.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteFunctionBlacklist.class);
    repo.registerComponent(infoRO, blacklist);
   
    if (blacklist instanceof ManageableFunctionBlacklist) {
      ComponentInfo infoMng = new ComponentInfo(ManageableFunctionBlacklist.class, classifier);
      infoMng.addAttribute(ComponentInfoAttributes.LEVEL, 1);
      infoMng.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteManageableFunctionBlacklist.class);
      repo.registerComponent(infoMng, blacklist);
    }
  }
View Full Code Here

    PositionMaster master = new EHCachingPositionMaster(getClassifier(),
                                                        getUnderlying(),
                                                        getCacheManager());

    // register
    ComponentInfo info = new ComponentInfo(PositionMaster.class, getClassifier());
    info.addAttribute(ComponentInfoAttributes.LEVEL, 2);
    info.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemotePositionMaster.class);
    repo.registerComponent(info, master);
    if (isPublishRest()) {
      repo.getRestComponents().publish(info, new DataPositionMasterResource(master));
    }
  }
View Full Code Here

    }

    protected MarketDataProviderFactory initMarketDataProviderFactory(final ComponentRepository repo) {
      InMemoryNamedMarketDataSpecificationRepository specRepository = new InMemoryNamedMarketDataSpecificationRepository();

      final ComponentInfo specRepositoryInfo = new ComponentInfo(NamedMarketDataSpecificationRepository.class, getClassifier());
      repo.registerComponent(specRepositoryInfo, specRepository);

      final ComponentInfo liveSourcesInfo = new ComponentInfo(NamedMarketDataSpecificationRepository.class, "live");
      repo.registerComponent(liveSourcesInfo, specRepository);

      return null;
    }
View Full Code Here

    OrganizationMaster master = new EHCachingOrganizationMaster(getClassifier(),
                                                      getUnderlying(),
                                                      getCacheManager());

    // register
    ComponentInfo info = new ComponentInfo(OrganizationMaster.class, getClassifier());
    info.addAttribute(ComponentInfoAttributes.LEVEL, 2);
    info.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteOrganizationMaster.class);
    repo.registerComponent(info, master);
    if (isPublishRest()) {
      repo.getRestComponents().publish(info, new DataOrganizationMasterResource(master));
    }
  }
View Full Code Here

      final String valueStr = configuration.get(key);
      Object targetValue = valueStr;
      if (valueStr.contains("::")) {
        final String type = StringUtils.substringBefore(valueStr, "::");
        final String classifier = StringUtils.substringAfter(valueStr, "::");
        final ComponentInfo info = repo.findInfo(type, classifier);
        if (info == null) {
          throw new IllegalArgumentException("Component not found: " + valueStr);
        }
        final Object instance = repo.getInstance(info);
        if ((instance instanceof CalcNodeSocketConfiguration) || (instance instanceof Supplier)) {
          targetValue = instance;
        } else {
          if (info.getUri() == null) {
            throw new OpenGammaRuntimeException("Unable to add component to configuration as it has not been published by REST: " + valueStr);
          }
          targetValue = new UriEndPointDescriptionProvider(info.getUri().toString());
        }
      }
      buildMap(map, key, targetValue);
    }
  }
View Full Code Here

    RegionMaster master = new EHCachingRegionMaster(getClassifier(),
                                                    getUnderlying(),
                                                    getCacheManager());

    // register
    ComponentInfo info = new ComponentInfo(RegionMaster.class, getClassifier());
    info.addAttribute(ComponentInfoAttributes.LEVEL, 2);
    info.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteRegionMaster.class);
    repo.registerComponent(info, master);
    if (isPublishRest()) {
      repo.getRestComponents().publish(info, new DataRegionMasterResource(master));
    }
  }
View Full Code Here

   */
  @Override
  public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) {
    InterpolatedYieldCurveSpecificationBuilder builder = createInterpolatedYieldCurveSpecificationBuilder(repo);
   
    ComponentInfo info = new ComponentInfo(InterpolatedYieldCurveSpecificationBuilder.class, getClassifier());
    info.addAttribute(ComponentInfoAttributes.LEVEL, 1);
    info.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteInterpolatedYieldCurveSpecificationBuilder.class);
    repo.registerComponent(info, builder);
    if (isPublishRest()) {
      repo.getRestComponents().publish(info, new DataInterpolatedYieldCurveSpecificationBuilderResource(builder));
    }
  }
View Full Code Here

  private boolean _publishRest = true;

  //-------------------------------------------------------------------------
  @Override
  public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) {
    ComponentInfo info = new ComponentInfo(FunctionCostsMaster.class, getClassifier());
   
    // create
    DbFunctionCostsMaster master = new DbFunctionCostsMaster(getDbConnector());
    checkSchema(master.getSchemaVersion(), "eng");
   
    // register
    info.addAttribute(ComponentInfoAttributes.LEVEL, 1);
    info.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteFunctionCostsMaster.class);
    repo.registerComponent(info, master);
   
    // publish
    if (isPublishRest()) {
      repo.getRestComponents().publish(info, new DataFunctionCostsMasterResource(master));
View Full Code Here

  private ConfigSource _configSource;

  //-------------------------------------------------------------------------
  @Override
  public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) {
    ComponentInfo info = new ComponentInfo(VolatilityCubeDefinitionSource.class, getClassifier());
    VolatilityCubeDefinitionSource base = new ConfigDBVolatilityCubeDefinitionSource(getConfigSource());
    VolatilityCubeDefinitionSource bbg = new ExampleVolatilityCubeDefinitionSource();
    VolatilityCubeDefinitionSource combined = new AggregatingVolatilityCubeDefinitionSource(Arrays.asList(bbg, base));
    repo.registerComponent(info, combined);
    if (isPublishRest()) {
View Full Code Here

TOP

Related Classes of com.opengamma.component.ComponentInfo

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.