1 of 1 people found this helpful
As for the version issue, the only way to set version is through the discovery component. Unfortunately, the component itself can't tell discovery the version number: https://bugzilla.redhat.com/show_bug.cgi?id=1000637
I think one hack would be to use some sort of static Map. Once the component is created and starts, it simply keeps in a static variable the version tied to a key. E.g. static Map<String, String> keyToVersionMap. You can then fetch the version in discovery. Note: Possible memory leak here.
Thanks for the bug reference. It actually describes a similar issue I am facing regarding partially discovering a resource and requiring user input before fully "discovering" the resource.
Amy Wu wrote:
I am working on an agent plugin where users are able to connect to a JMX MBean server either remotely or via local attach. Is there some sort of ConnectionSettingsListener that allows me to be notified if the user makes a change in the connection settings page? I want to ensure that if the user decides to switch from local to remote, the agent plugin will switch how it is connecting to the MBean server.
This should be automatic. As soon as you change your plugin configuration (aka connection properties, which IMHO better describes its intended purpose), your resource component on the agent is stopped and started anew with the updated plugin configuration.
Okay, thanks, this is good to know that the resource component will always be stopped and started again whenever there is an update to the connection properties. So then we can store how we are connecting to the server currently and whenever our component is stopped and started again, we can check if the current connection settings have changed from what we have stored in our member variable.