Package com.opengamma.component

Examples of com.opengamma.component.ComponentInfo


  private Scheduler _scheduler;

  @Override
  public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) throws Exception {
   
    ComponentInfo info = new ComponentInfo(Trigger.class, getClassifier());
   
    final Map<String, Object> jobDataAsMap = Maps.newHashMap();
    jobDataAsMap.put("observationTime", getObservationTime());
    if (getDataSource() != null) {
      jobDataAsMap.put("dataSource", getDataSource());
View Full Code Here


  private String _dataFieldBlackList;
 
  @Override
  public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) throws Exception {
   
    ComponentInfo info = new ComponentInfo(JobDetail.class, getClassifier());
   
    JobDetailBean jobDetailBean = new JobDetailBean();
    jobDetailBean.setBeanName(getName());
    jobDetailBean.setJobClass(QuartzRedisHtsSnapshotJob.class);
    if (getGroup() != null) {
View Full Code Here

  @PropertyDefinition(validate = "notNull")
  private String _classifier;
   
  @Override
  public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) throws Exception {
    ComponentInfo info = new ComponentInfo(Scheduler.class, getClassifier());
   
    Properties quartzProperties = new Properties();
    quartzProperties.setProperty(StdSchedulerFactory.PROP_SCHED_JMX_EXPORT, "true");
    quartzProperties.setProperty(StdSchedulerFactory.PROP_SCHED_SKIP_UPDATE_CHECK, "true");
   
View Full Code Here

   
    // Populate the tool context from the remote component server
    for (MetaProperty<?> metaProperty : toolContext.metaBean().metaPropertyIterable()) {
      if (!metaProperty.name().equals("contextManager")) {
        try {
          ComponentInfo componentInfo = getComponentInfo(componentServer, classifierChain, metaProperty.propertyType());
          if (componentInfo == null) {
            s_logger.warn("Unable to populate tool context '" + metaProperty.name() +
                "', no appropriate component found on the server");
            continue;
          }
          if (ViewProcessor.class.equals(componentInfo.getType())) {
            final JmsConnector jmsConnector = createJmsConnector(componentInfo);
            final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("rvp"));
            ViewProcessor vp = new RemoteViewProcessor(componentInfo.getUri(), jmsConnector, scheduler);
            toolContext.setViewProcessor(vp);
            toolContext.setContextManager(new Closeable() {
              @Override
              public void close() throws IOException {
                scheduler.shutdownNow();
                jmsConnector.close();
              }
            });
          } else {
            String clazzName = componentInfo.getAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA);
            if (clazzName == null) {
              s_logger.warn("Unable to populate tool context '" + metaProperty.name() +
                  "', no remote access class found");
              continue;
            }
            Class<?> clazz = Class.forName(clazzName);
            metaProperty.set(toolContext, clazz.getConstructor(URI.class).newInstance(componentInfo.getUri()));
            s_logger.info("Populated tool context '" + metaProperty.name() + "' with " + metaProperty.get(toolContext));
          }
        } catch (Throwable ex) {
          s_logger.warn("Unable to populate tool context '" + metaProperty.name() + "': " + ex.getMessage());
        }
View Full Code Here

  private static ComponentInfo getComponentInfo(ComponentServer componentServer, List<String> preferenceList, Class<?> type) {
    Map<String, ComponentInfo> infos = componentServer.getComponentInfoMap(type);
    if (preferenceList != null) {
      for (String preference : preferenceList) {
        ComponentInfo componentInfo = infos.get(preference);
        if (componentInfo != null) {
          return componentInfo;
        }
      }
    }
View Full Code Here

  private CacheManager _cacheManager;

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

    final ComponentInfo info = new ComponentInfo(MBeanServer.class, getClassifier());
    final MBeanServer component = initMBeanServerAndRegisterCacheMananager(repo);
    repo.registerComponent(info, component);

  }
View Full Code Here

  private Integer _maxRetries;

  //-------------------------------------------------------------------------
  @Override
  public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) {
    ComponentInfo info = new ComponentInfo(ConfigMaster.class, getClassifier());
   
    // create
    DbConfigMaster master = new DbConfigMaster(getDbConnector());
    master.registerMetrics(OpenGammaMetricRegistry.getSummaryInstance(), OpenGammaMetricRegistry.getDetailedInstance(), "DbConfigMaster-" + 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());
    }
    checkSchema(master.getSchemaVersion(), "cfg");
   
    // register
    info.addAttribute(ComponentInfoAttributes.LEVEL, 1);
    info.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteConfigMaster.class);
    info.addAttribute(ComponentInfoAttributes.UNIQUE_ID_SCHEME, master.getUniqueIdScheme());
    repo.registerComponent(info, master);
   
    // publish
    if (isPublishRest()) {
      repo.getRestComponents().publish(info, new DataConfigMasterResource(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 SecurityEnhancer loader = createSecurityEnhancer(repo);
    final ComponentInfo info = new ComponentInfo(SecurityEnhancer.class, getClassifier());
    info.addAttribute(ComponentInfoAttributes.LEVEL, 1);
    info.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteSecurityEnhancer.class);
    repo.registerComponent(info, loader);
    if (isPublishRest()) {
      repo.getRestComponents().publish(info, new DataSecurityEnhancerResource(loader));
    }
  }
View Full Code Here

 
  private ComponentInfo getTopLevelComponent(List<String> preferenceList, Class<?> type) {
    if (preferenceList != null) {
      for (String preference : preferenceList) {
        try {
          ComponentInfo componentInfo = getComponentServer().getComponentInfo(type, preference);
          if (componentInfo != null) {
            return componentInfo;
          }
        } catch (IllegalArgumentException iae) {
          // do nothing and try the next one.
View Full Code Here

    return componentInfos.size() == 0 ? null : componentInfos.get(0);
  }
 
  //-------------------------------------------------------------------------
  public RemoteViewProcessor getViewProcessor(String vpId) {
    ComponentInfo info = getComponentServer().getComponentInfo(ViewProcessor.class, "main");
    URI uri = info.getUri();
    JmsConnector jmsConnector = getJmsConnector(info);
    return new RemoteViewProcessor(uri, jmsConnector, Executors.newSingleThreadScheduledExecutor());
  }
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.