All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.drools.rhq.plugin.ExposeKCIDValueFromParentDiscoveryComponent Maven / Gradle / Ivy

There is a newer version: 7.11.0.Final
Show newest version
package org.drools.rhq.plugin;

import org.rhq.plugins.jmx.JMXComponent;
import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;

import java.util.Set;

public class ExposeKCIDValueFromParentDiscoveryComponent extends MBeanResourceDiscoveryComponent {

    public Set performDiscovery(Configuration pluginConfiguration,
                                                           JMXComponent parentResourceComponent, ResourceType resourceType, boolean skipUnknownProps) {
        Set services = super.performDiscovery(
                pluginConfiguration, parentResourceComponent, resourceType, skipUnknownProps);

        String kcId = this.discoveryContext.getParentResourceContext()
                .getPluginConfiguration().getSimpleValue("kcontainerId");
        for (DiscoveredResourceDetails service: services) {
            service.getPluginConfiguration().setSimpleValue("kcId", kcId);
        }

        return services;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy