-
1. Re: How does an agent plugin know when a connection setting has changed?
genman Dec 12, 2013 2:50 PM (in response to amyw)1 of 1 people found this helpfulAs 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.
-
2. Re: How does an agent plugin know when a connection setting has changed?
amyw Dec 12, 2013 4:04 PM (in response to genman)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.
-
3. Re: How does an agent plugin know when a connection setting has changed?
lkrejci Dec 12, 2013 5:26 PM (in response to amyw)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.
-
4. Re: How does an agent plugin know when a connection setting has changed?
amyw Dec 16, 2013 1:17 PM (in response to lkrejci)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.