Package com.opengamma.component

Examples of com.opengamma.component.ComponentInfo


  private String _configLocation = DEFAULT_EHCACHE_CONFIG;

  @Override
  public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) throws Exception {

    final ComponentInfo info = new ComponentInfo(CacheManager.class, getClassifier());
    final CacheManager component = initCacheManager();
    repo.registerComponent(info, component);
    repo.registerLifecycleStop(component, "shutdown");

  }
View Full Code Here


  private Class<? extends SecurityMasterDetailProvider> _detailProvider = HibernateSecurityMasterDetailProvider.class;

  //-------------------------------------------------------------------------
  @Override
  public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) throws Exception {
    ComponentInfo info = new ComponentInfo(SecurityMaster.class, getClassifier());
   
    // create
    DbSecurityMaster master = new DbSecurityMaster(getDbConnector());
    master.registerMetrics(OpenGammaMetricRegistry.getSummaryInstance(), OpenGammaMetricRegistry.getDetailedInstance(), "DbSecurityMaster-" + getClassifier());
    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());
    }
    if (getDetailProvider() != null) {
      SecurityMasterDetailProvider dp = getDetailProvider().newInstance();
      if (getCacheManager() != null) {
        master.setDetailProvider(new EHCachingSecurityMasterDetailProvider(dp, getCacheManager()));
      } else {
        master.setDetailProvider(dp);
      }
    }
    checkSchema(master.getSchemaVersion(), "sec");
   
    // register
    info.addAttribute(ComponentInfoAttributes.LEVEL, 1);
    info.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteSecurityMaster.class);
    info.addAttribute(ComponentInfoAttributes.UNIQUE_ID_SCHEME, master.getUniqueIdScheme());
    repo.registerComponent(info, master);
   
    // publish
    if (isPublishRest()) {
      repo.getRestComponents().publish(info, new DataDbSecurityMasterResource(master));
View Full Code Here

 
  @Override
  public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) throws Exception {
    RedisConnector redisConnector = new RedisConnector(getClassifier(), getHostName(), getRedisPort(), getPassword());
   
    ComponentInfo info = new ComponentInfo(RedisConnector.class, getClassifier());
    repo.registerComponent(info, redisConnector);
  }
View Full Code Here

   * @param configuration  the remaining configuration, not null
   */
  @Override
  public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) throws Exception {
    final SecurityLoader loader = createSecurityLoader(repo);
    final ComponentInfo info = new ComponentInfo(SecurityLoader.class, getClassifier());
    info.addAttribute(ComponentInfoAttributes.LEVEL, 1);
    info.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteSecurityLoader.class);
    repo.registerComponent(info, loader);
    if (isPublishRest()) {
      repo.getRestComponents().publish(info, new DataSecurityLoaderResource(loader));
    }
  }
View Full Code Here

    MarketDataSnapshotMaster master = new EHCachingMarketDataSnapshotMaster(getClassifier(),
                                                      getUnderlying(),
                                                      getCacheManager());

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

   * @param configuration  the remaining configuration, not null
   */
  @Override
  public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) throws Exception {
    final SecurityProvider provider = createSecurityProvider(repo);
    final ComponentInfo info = new ComponentInfo(SecurityProvider.class, getClassifier());
    info.addAttribute(ComponentInfoAttributes.LEVEL, 1);
    info.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteSecurityProvider.class);
    repo.registerComponent(info, provider);
    if (isPublishRest()) {
      repo.getRestComponents().publish(info, new DataSecurityProviderResource(provider));
    }
  }
View Full Code Here


  @Override
  public void init(final ComponentRepository repo, final LinkedHashMap<String, String> configuration) {
    final SecurityMaster master = new InMemorySecurityMaster();
    final ComponentInfo info = new ComponentInfo(SecurityMaster.class, getClassifier());
    info.addAttribute(ComponentInfoAttributes.LEVEL, 1);
    info.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteSecurityMaster.class);
    info.addAttribute(ComponentInfoAttributes.UNIQUE_ID_SCHEME, InMemorySecurityMaster.DEFAULT_OID_SCHEME);
    repo.registerComponent(info, master);

    if (isPublishRest()) {
      repo.getRestComponents().publish(info, new DataSecurityMasterResource(master));
    }
View Full Code Here

    UserMaster master = new EHCachingUserMaster(getClassifier(),
                                                getUnderlying(),
                                                getCacheManager());

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

      map.put(scheme, userSource);
      source = new DelegatingConfigSource(source, map);
    }

    // register
    ComponentInfo info = new ComponentInfo(ConfigSource.class, getClassifier());
    info.addAttribute(ComponentInfoAttributes.LEVEL, 2);
    info.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteConfigSource.class);
    repo.registerComponent(info, source);
    if (isPublishRest()) {
      repo.getRestComponents().publish(info, new DataConfigSourceResource(source));
    }
  }
View Full Code Here

    ConfigSource source = new MasterConfigSource(getUnderlyingConfigMaster());
    if (getCacheManager() != null) {
      source = new EHCachingMasterConfigSource(getUnderlyingConfigMaster(), getCacheManager());
    }
    if (getUnderlyingClassifier() != null) {
      ComponentInfo info = new ComponentInfo(ConfigSource.class, getUnderlyingClassifier());
      info.addAttribute(ComponentInfoAttributes.LEVEL, 1);
      info.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteConfigSource.class);
      repo.registerComponent(info, source);
      if (isPublishRest()) {
        repo.getRestComponents().publish(info, new DataConfigSourceResource(source));
      }
    }
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.