service provider
mechanism to search the JConsole plugins.
Users can provide their JConsole plugins in a jar file
containing a file named
META-INF/services/com.sun.tools.jconsole.JConsolePlugin
This file contains one line for each plugin, for example,
com.sun.example.JTop
which is the fully qualified class name of the class implementing
JConsolePlugin
.
To load the JConsole plugins in JConsole, run:
jconsole -pluginpath <plugin-path>
where <plugin-path>
specifies the paths of JConsole
plugins to look up which can be a directory or a jar file. Multiple
paths are separated by the path separator character of the platform.
When a new JConsole window is created for a connection,
an instance of each JConsolePlugin
will be created.
The JConsoleContext
object is not available at its
construction time.
JConsole will set the JConsoleContext
object for
a plugin after the plugin object is created. It will then
call its getTabs
method and add the returned
tabs to the JConsole window.
java.util.ServiceLoader
Modifier and Type | Field and Description |
---|---|
private volatile JConsoleContext | |
private List |
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
public final void | addContextPropertyChangeListener(PropertyChangeListener
The listener)PropertyChangeListener to be addedAdds a |
public void | |
public final JConsoleContext | Returns: theJConsoleContext object representing
the connection to an application.Returns the |
public abstract Map | |
public abstract SwingWorker | Returns: aSwingWorker to perform the GUI update; or
null .Returns a |
public final void | removeContextPropertyChangeListener(PropertyChangeListener
the listener)PropertyChangeListener to be removedRemoves a |
public final synchronized void | setContext(JConsoleContext
a context)JConsoleContext objectSets the |
context | back to summary |
---|---|
private volatile JConsoleContext context |
listeners | back to summary |
---|---|
private List<PropertyChangeListener> listeners |
JConsolePlugin | back to summary |
---|---|
protected JConsolePlugin() Constructor. |
addContextPropertyChangeListener | back to summary |
---|---|
public final void addContextPropertyChangeListener(PropertyChangeListener listener) Adds a For example, a plugin constructor can
call this method to register a listener to listen to the
|
dispose | back to summary |
---|---|
public void dispose() Dispose this plugin. This method is called by JConsole to inform
that this plugin will be discarded and that it should free
any resources that it has allocated.
The |
getContext | back to summary |
---|---|
public final JConsoleContext getContext() Returns the
|
getTabs | back to summary |
---|---|
public abstract Map Returns the tabs to be added in JConsole window.
The returned map contains one entry for each tab
to be added in the tabbed pane in a JConsole window with
the tab name as the key
and the |
newSwingWorker | back to summary |
---|---|
public abstract SwingWorker Returns a
JConsole schedules the GUI update at an interval specified
for a connection. This method will be called at every
update to obtain a
JConsole will invoke the
Otherwise, SwingWorker object will not be scheduled to work.
A plugin can schedule its own GUI update and this method
will return
|
removeContextPropertyChangeListener | back to summary |
---|---|
public final void removeContextPropertyChangeListener(PropertyChangeListener listener) Removes a
|
setContext | back to summary |
---|---|
public final synchronized void setContext(JConsoleContext context) Sets the
|