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 Class Summary
Nested Classes Modifier and Type Interface Description static class
JConsoleContext.ConnectionState
Values for the ConnectionState bound property. -
Field Summary
Fields Modifier and Type Field Description static String
CONNECTION_STATE_PROPERTY
TheConnectionState
bound property name. -
Method Summary
Modifier and Type Method Description void
addPropertyChangeListener(PropertyChangeListener listener)
Add aPropertyChangeListener
to the listener list.JConsoleContext.ConnectionState
getConnectionState()
Returns the current connection state.MBeanServerConnection
getMBeanServerConnection()
Returns theMBeanServerConnection
for the connection to an application.void
removePropertyChangeListener(PropertyChangeListener listener)
Removes aPropertyChangeListener
from the listener list.
-
Field Details
-
CONNECTION_STATE_PROPERTY
TheConnectionState
bound property name.- See Also:
- Constant Field Values
-
-
Method Details
-
getMBeanServerConnection
MBeanServerConnection getMBeanServerConnection()Returns theMBeanServerConnection
for the connection to an application. The returnedMBeanServerConnection
object becomes invalid when the connection state is changed to theDISCONNECTED
state.- Returns:
- the
MBeanServerConnection
for the connection to an application.
-
getConnectionState
JConsoleContext.ConnectionState getConnectionState()Returns the current connection state.- Returns:
- the current connection state.
-
addPropertyChangeListener
Add aPropertyChangeListener
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. Iflistener
isnull
, no exception is thrown and no action is taken.- Parameters:
listener
- ThePropertyChangeListener
to be added
-
removePropertyChangeListener
Removes aPropertyChangeListener
from the listener list. This removes aPropertyChangeListener
that was registered for all properties. Iflistener
was added more than once to the same event source, it will be notified one less time after being removed. Iflistener
isnull
, or was never added, no exception is thrown and no action is taken.- Parameters:
listener
- thePropertyChangeListener
to be removed
-