Created
September 1, 2016 00:11
-
-
Save josejulio/b2b0d9dedddd99c3191d0a712b2173aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.rhq.plugins.myplugin; | |
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; | |
/** | |
* Created by josejulio on 8/31/16. | |
*/ | |
public class ExampleMBeanResourceDiscoveryComponent extends MBeanResourceDiscoveryComponent { | |
public Set<DiscoveredResourceDetails> performDiscovery(Configuration pluginConfiguration, | |
JMXComponent parentResourceComponent, ResourceType resourceType, boolean skipUnknownProps) { | |
Set<DiscoveredResourceDetails> 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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment