Interface JConsoleContext
public interface JConsoleContext
JConsoleContext represents a JConsole connection to a target application.
JConsoleContext notifies any PropertyChangeListeners about the ConnectionState property change to CONNECTED and DISCONNECTED. The JConsoleContext instance will be the source for any generated events.
- Since:
- 1.6
Nested Classes
| Modifier and Type | Interface | Description |
|---|---|---|
static class | JConsoleContext.ConnectionState | Values for the ConnectionState bound property. |
Fields
| Modifier and Type | Field | Description |
|---|---|---|
static String | CONNECTION_STATE_PROPERTY | The |
Methods
| Modifier and Type | Method | Description |
|---|---|---|
void | addPropertyChangeListener(PropertyChangeListener listener) | Add a |
JConsoleContext.ConnectionState | getConnectionState() | Returns the current connection state. |
MBeanServerConnection | getMBeanServerConnection() | Returns the |
void | removePropertyChangeListener(PropertyChangeListener listener) | Removes a |
Fields
CONNECTION_STATE_PROPERTY
static final String CONNECTION_STATE_PROPERTY
The ConnectionState bound property name.
- See Also:
- Constant Field Values
Methods
getMBeanServerConnection
MBeanServerConnection getMBeanServerConnection()
Returns the MBeanServerConnection for the connection to an application. The returned MBeanServerConnection object becomes invalid when the connection state is changed to the DISCONNECTED state.
- Returns:
- the
MBeanServerConnectionfor the connection to an application.
getConnectionState
JConsoleContext.ConnectionState getConnectionState()
Returns the current connection state.
- Returns:
- the current connection state.
addPropertyChangeListener
void addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties. The same listener object may be added more than once, and will be called as many times as it is added. If listener is null, no exception is thrown and no action is taken.
- Parameters:
-
listener- ThePropertyChangeListenerto be added
removePropertyChangeListener
void removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties. If listener was added more than once to the same event source, it will be notified one less time after being removed. If listener is null, or was never added, no exception is thrown and no action is taken.
- Parameters:
-
listener- thePropertyChangeListenerto be removed
© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/11/docs/api/jdk.jconsole/com/sun/tools/jconsole/JConsoleContext.html