Пример #1
0
  /**
   * Start the resource connection
   *
   * @see
   *     org.rhq.core.pluginapi.inventory.ResourceComponent#start(org.rhq.core.pluginapi.inventory.ResourceContext)
   */
  public void start(ResourceContext context) throws InvalidPluginConfigurationException, Exception {
    this.context = context;
    pluginConfiguration = context.getPluginConfiguration();

    if (!(context.getParentResourceComponent() instanceof BaseComponent)) {
      host = pluginConfiguration.getSimpleValue("hostname", LOCALHOST);
      String portString = pluginConfiguration.getSimpleValue("port", DEFAULT_HTTP_MANAGEMENT_PORT);
      port = Integer.parseInt(portString);
      connection = new ASConnection(host, port);
    } else {
      connection = ((BaseComponent) context.getParentResourceComponent()).getASConnection();
    }

    path = pluginConfiguration.getSimpleValue("path", null);
    address = new Address(path);
    key = context.getResourceKey();

    myServerName =
        context.getResourceKey().substring(context.getResourceKey().lastIndexOf("/") + 1);
  }
Пример #2
0
 /** Start the resource connection */
 @Override
 public void start(ResourceContext<CacheManagerComponent> context) {
   this.context = context;
   this.cacheManagerName = context.getParentResourceComponent().context.getResourceKey();
   this.cacheName = context.getResourceKey();
   if (log.isTraceEnabled())
     log.trace(
         "Start cache component for cache manager "
             + cacheManagerName
             + " with cache key "
             + cacheName);
 }
Пример #3
0
 protected void internalStart() throws Exception {
   Configuration pluginConfig = context.getPluginConfiguration();
   String connectionTypeDescriptorClassName =
       pluginConfig.getSimple(JMXDiscoveryComponent.CONNECTION_TYPE).getStringValue();
   if (JMXDiscoveryComponent.PARENT_TYPE.equals(connectionTypeDescriptorClassName)) {
     // Our parent is itself a JMX component, so just reuse its connection.
     this.connection = ((JMXComponent) context.getParentResourceComponent()).getEmsConnection();
     this.connectionProvider = this.connection.getConnectionProvider();
   } else {
     this.connectionProvider =
         ConnectionProviderFactory.createConnectionProvider(
             pluginConfig, this.context.getNativeProcess(), this.context.getTemporaryDirectory());
     this.connection = this.connectionProvider.connect();
     this.connection.loadSynchronous(false);
   }
 }
Пример #4
0
 private EmsConnection getConnection() {
   return context.getParentResourceComponent().getEmsConnection();
 }