JDK-6418510 : Provide a convenient method in JConsolePlugin for adding listener
  • Type: Bug
  • Component: tools
  • Sub-Component: jconsole
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-04-26
  • Updated: 2017-05-16
  • Resolved: 2006-05-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b85Fixed
Related Reports
Relates :  
Description
JConsole supports connect/disconnect/reconnect cycle.  Most plugins would likely want to be notified for the connection state property change to deal with the disconnect/reconnect situation.

Currently the plugin would have to override the setContext() method with the following:
   super.setContext(context);
   context.addPropertyChangeListener(listener);

For any plugin which wants to register a listener has to do the same as above.

So having JConsolePlugin to implement PropertyChangeListener will improve the API.

Comments
SUGGESTED FIX See attached webrev.tar
08-05-2006

EVALUATION Add two new methods: public void addContextPropertyChangeListener(PropertyChangeListener l); public void removeContextPropertyChangeListener(PropertyChangeListener l); A plugin can call the addContextPropertyChangeListener method at constructor time and doesn't need to override setContext() method.
26-04-2006