APIdia Launch Partner
Top Inners Fields Constructors Methods
sun.tools.jconsole

public Class ProxyClient

extends Object
implements JConsoleContext
Class Inheritance
All Implemented Interfaces
com.sun.tools.jconsole.JConsoleContext
Imports
com.sun.management.HotSpotDiagnosticMXBean, com.sun.tools.jconsole.JConsoleContext, java.beans.PropertyChangeListener, .PropertyChangeEvent, java.io.IOException, java.lang.management.*, java.lang.ref.WeakReference, java.lang.reflect.*, java.net.URI, java.rmi.*, java.rmi.registry.*, java.rmi.server.*, java.util.*, javax.management.*, javax.management.remote.*, javax.management.remote.rmi.*, javax.rmi.ssl.SslRMIClientSocketFactory, javax.swing.event.SwingPropertyChangeSupport, sun.rmi.server.UnicastRef2, sun.rmi.transport.LiveRef

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
pack-priv static class
public static interface
private class
ProxyClient.WeakPCL

The PropertyChangeListener is handled via a WeakReference so as not to pin down the listener.

Field Summary

Modifier and TypeField and Description
private String
private static Map<String, ProxyClient>
private ClassLoadingMXBean
private CompilationMXBean
private final String
private JConsoleContext.ConnectionState
private final String
private List<GarbageCollectorMXBean>
private boolean
private boolean
private boolean
private String
private static final String
private HotSpotDiagnosticMXBean
private volatile boolean
private JMXConnector
private JMXServiceURL
private LocalVirtualMachine
private MBeanServerConnection
private MemoryMXBean
private List<MemoryPoolProxy>
private OperatingSystemMXBean
private String
private int
private SwingPropertyChangeSupport
private String
private int
private static final Class<? extends Remote>
private static final String
private RuntimeMXBean
private ProxyClient.SnapshotMBeanServerConnection
private boolean
private static final SslRMIClientSocketFactory
private boolean
private RMIServer
private OperatingSystemMXBean
private boolean
private ThreadMXBean
private String
private boolean

Constructor Summary

AccessConstructor and Description
private
ProxyClient(String hostName, int port, String userName, String password)

private
ProxyClient(String url, String userName, String password)

private

Method Summary

Modifier and TypeMethod and Description
public void
public void
private void
private static void
checkStub(Remote stub, Class<? extends Remote> stubClass)

pack-priv void
connect(boolean requireSSL)

public String
public void
public long[]
pack-priv void
public AttributeList
getAttributes(ObjectName name, String[] attributes)

Returns a list of attributes of a named MBean.

private static String
private static String
getCacheKey(String url, String userName, String password)

private static String
getCacheKey(String hostName, int port, String userName, String password)

public synchronized ClassLoadingMXBean
public synchronized CompilationMXBean
public static String
public static String
public static String
getConnectionName(String hostName, int port, String userName)

public JConsoleContext.ConnectionState
getConnectionState()

Implements com.sun.tools.jconsole.JConsoleContext.getConnectionState.

Returns the current connection state.

public String
public String[]
getDomains()

Returns the list of domains in which any MBean is currently registered.

public synchronized Collection<GarbageCollectorMXBean>
public String
public synchronized HotSpotDiagnosticMXBean
public Map<ObjectName, MBeanInfo>
getMBeans(String domain)

Returns a map of MBeans with ObjectName as the key and MBeanInfo value of a given domain.

public MBeanServerConnection
public synchronized MemoryMXBean
public Collection<MemoryPoolProxy>
public <T> T
getMXBean(ObjectName objName, Class<T> interfaceClass)

public synchronized OperatingSystemMXBean
public String
public int
public static ProxyClient
getProxyClient(LocalVirtualMachine lvm)

Gets a proxy client for a given local virtual machine.

public static ProxyClient
getProxyClient(String url, String userName, String password)

Gets a proxy client for a given JMXServiceURL.

public static ProxyClient
getProxyClient(String hostName, int port, String userName, String password)

Gets a proxy client for a given "hostname:port".

public synchronized RuntimeMXBean
public ProxyClient.SnapshotMBeanServerConnection
public synchronized OperatingSystemMXBean
public synchronized ThreadMXBean
public String
public String
public int
pack-priv boolean
pack-priv boolean
public Object
invoke(ObjectName name, String operationName, Object[] params, String[] signature)

Invokes an operation of a named MBean.

pack-priv boolean
public boolean
pack-priv boolean
public boolean
public boolean
isSslRmiRegistry()

Returns true if the underlying RMI registry is SSL-protected.

public boolean
isSslRmiStub()

Returns true if the retrieved RMI stub is SSL-protected.

public boolean
isVmConnector()

Returns true if this ProxyClient denotes a JMX connector for a JMX VM agent.

public synchronized void
public void
public void
setAttribute(ObjectName name, Attribute attribute)

Set the value of a specific attribute of a named MBean.

private void
private void
setParameters(JMXServiceURL url, String userName, String password)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

private void
tryConnect(boolean requireRemoteSSL)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

advancedUrlback to summary
private String advancedUrl
cacheback to summary
private static Map<String, ProxyClient> cache
classLoadingMBeanback to summary
private ClassLoadingMXBean classLoadingMBean
compilationMBeanback to summary
private CompilationMXBean compilationMBean
connectionNameback to summary
private final String connectionName
connectionStateback to summary
private JConsoleContext.ConnectionState connectionState
displayNameback to summary
private final String displayName
garbageCollectorMBeansback to summary
private List<GarbageCollectorMXBean> garbageCollectorMBeans
hasCompilationMXBeanback to summary
private boolean hasCompilationMXBean
hasHotSpotDiagnosticMXBeanback to summary
private boolean hasHotSpotDiagnosticMXBean
hasPlatformMXBeansback to summary
private boolean hasPlatformMXBeans
hostNameback to summary
private String hostName
HOTSPOT_DIAGNOSTIC_MXBEAN_NAMEback to summary
private static final String HOTSPOT_DIAGNOSTIC_MXBEAN_NAME
hotspotDiagnosticMXBeanback to summary
private HotSpotDiagnosticMXBean hotspotDiagnosticMXBean
isDeadback to summary
private volatile boolean isDead
jmxcback to summary
private JMXConnector jmxc
jmxUrlback to summary
private JMXServiceURL jmxUrl
lvmback to summary
private LocalVirtualMachine lvm
mbscback to summary
private MBeanServerConnection mbsc
memoryMBeanback to summary
private MemoryMXBean memoryMBean
memoryPoolProxiesback to summary
private List<MemoryPoolProxy> memoryPoolProxies
operatingSystemMBeanback to summary
private OperatingSystemMXBean operatingSystemMBean
passwordback to summary
private String password
portback to summary
private int port
propertyChangeSupportback to summary
private SwingPropertyChangeSupport propertyChangeSupport
registryHostNameback to summary
private String registryHostName
registryPortback to summary
private int registryPort
rmiServerImplStubClassback to summary
private static final Class<? extends Remote> rmiServerImplStubClass
rmiServerImplStubClassNameback to summary
private static final String rmiServerImplStubClassName
runtimeMBeanback to summary
private RuntimeMXBean runtimeMBean
serverback to summary
private ProxyClient.SnapshotMBeanServerConnection server
sslRegistryback to summary
private boolean sslRegistry
sslRMIClientSocketFactoryback to summary
private static final SslRMIClientSocketFactory sslRMIClientSocketFactory
sslStubback to summary
private boolean sslStub
stubback to summary
private RMIServer stub
sunOperatingSystemMXBeanback to summary
private OperatingSystemMXBean sunOperatingSystemMXBean
supportsLockUsageback to summary
private boolean supportsLockUsage
threadMBeanback to summary
private ThreadMXBean threadMBean
userNameback to summary
private String userName
vmConnectorback to summary
private boolean vmConnector

Constructor Detail

ProxyClientback to summary
private ProxyClient(String hostName, int port, String userName, String password) throws IOException
ProxyClientback to summary
private ProxyClient(String url, String userName, String password) throws IOException
ProxyClientback to summary
private ProxyClient(LocalVirtualMachine lvm) throws IOException

Method Detail

addPropertyChangeListenerback to summary
public void addPropertyChangeListener(PropertyChangeListener listener)

Implements com.sun.tools.jconsole.JConsoleContext.addPropertyChangeListener.

Doc from com.sun.tools.jconsole.JConsoleContext.addPropertyChangeListener.

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.

addWeakPropertyChangeListenerback to summary
public void addWeakPropertyChangeListener(PropertyChangeListener listener)
checkSslConfigback to summary
private void checkSslConfig() throws IOException
checkStubback to summary
private static void checkStub(Remote stub, Class<? extends Remote> stubClass)
connectback to summary
pack-priv void connect(boolean requireSSL)
connectionNameback to summary
public String connectionName()
disconnectback to summary
public void disconnect()
findDeadlockedThreadsback to summary
public long[] findDeadlockedThreads() throws IOException
flushback to summary
pack-priv void flush()
getAttributesback to summary
public AttributeList getAttributes(ObjectName name, String[] attributes) throws IOException

Returns a list of attributes of a named MBean.

getCacheKeyback to summary
private static String getCacheKey(LocalVirtualMachine lvm)
getCacheKeyback to summary
private static String getCacheKey(String url, String userName, String password)
getCacheKeyback to summary
private static String getCacheKey(String hostName, int port, String userName, String password)
getClassLoadingMXBeanback to summary
public synchronized ClassLoadingMXBean getClassLoadingMXBean() throws IOException
getCompilationMXBeanback to summary
public synchronized CompilationMXBean getCompilationMXBean() throws IOException
getConnectionNameback to summary
public static String getConnectionName(LocalVirtualMachine lvm)
getConnectionNameback to summary
public static String getConnectionName(String url, String userName)
getConnectionNameback to summary
public static String getConnectionName(String hostName, int port, String userName)
getConnectionStateback to summary
public JConsoleContext.ConnectionState getConnectionState()

Implements com.sun.tools.jconsole.JConsoleContext.getConnectionState.

Doc from com.sun.tools.jconsole.JConsoleContext.getConnectionState.

Returns the current connection state.

getDisplayNameback to summary
public String getDisplayName()
getDomainsback to summary
public String[] getDomains() throws IOException

Returns the list of domains in which any MBean is currently registered.

getGarbageCollectorMXBeansback to summary
public synchronized Collection<GarbageCollectorMXBean> getGarbageCollectorMXBeans() throws IOException
getHostNameback to summary
public String getHostName()
getHotSpotDiagnosticMXBeanback to summary
public synchronized HotSpotDiagnosticMXBean getHotSpotDiagnosticMXBean() throws IOException
getMBeansback to summary
public Map<ObjectName, MBeanInfo> getMBeans(String domain) throws IOException

Returns a map of MBeans with ObjectName as the key and MBeanInfo value of a given domain. If domain is null, all MBeans are returned. If no MBean found, an empty map is returned.

getMBeanServerConnectionback to summary
public MBeanServerConnection getMBeanServerConnection()

Implements com.sun.tools.jconsole.JConsoleContext.getMBeanServerConnection.

Doc from com.sun.tools.jconsole.JConsoleContext.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.

getMemoryMXBeanback to summary
public synchronized MemoryMXBean getMemoryMXBean() throws IOException
getMemoryPoolProxiesback to summary
public Collection<MemoryPoolProxy> getMemoryPoolProxies() throws IOException
getMXBeanback to summary
public <T> T getMXBean(ObjectName objName, Class<T> interfaceClass) throws IOException
getOperatingSystemMXBeanback to summary
public synchronized OperatingSystemMXBean getOperatingSystemMXBean() throws IOException
getPasswordback to summary
public String getPassword()
getPortback to summary
public int getPort()
getProxyClientback to summary
public static ProxyClient getProxyClient(LocalVirtualMachine lvm) throws IOException

Gets a proxy client for a given local virtual machine.

getProxyClientback to summary
public static ProxyClient getProxyClient(String url, String userName, String password) throws IOException

Gets a proxy client for a given JMXServiceURL.

getProxyClientback to summary
public static ProxyClient getProxyClient(String hostName, int port, String userName, String password) throws IOException

Gets a proxy client for a given "hostname:port".

getRuntimeMXBeanback to summary
public synchronized RuntimeMXBean getRuntimeMXBean() throws IOException
getSnapshotMBeanServerConnectionback to summary
public ProxyClient.SnapshotMBeanServerConnection getSnapshotMBeanServerConnection()
getSunOperatingSystemMXBeanback to summary
public synchronized OperatingSystemMXBean getSunOperatingSystemMXBean() throws IOException
getThreadMXBeanback to summary
public synchronized ThreadMXBean getThreadMXBean() throws IOException
getUrlback to summary
public String getUrl()
getUserNameback to summary
public String getUserName()
getVmidback to summary
public int getVmid()
hasHotSpotDiagnosticMXBeanback to summary
pack-priv boolean hasHotSpotDiagnosticMXBean()
hasPlatformMXBeansback to summary
pack-priv boolean hasPlatformMXBeans()
invokeback to summary
public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws IOException, MBeanException

Invokes an operation of a named MBean.

Exceptions
MBeanException:
Wraps an exception thrown by the MBean's invoked method.
isConnectedback to summary
pack-priv boolean isConnected()
isDeadback to summary
public boolean isDead()
isLockUsageSupportedback to summary
pack-priv boolean isLockUsageSupported()
isRegisteredback to summary
public boolean isRegistered(ObjectName name) throws IOException
isSslRmiRegistryback to summary
public boolean isSslRmiRegistry()

Returns true if the underlying RMI registry is SSL-protected.

Exceptions
UnsupportedOperationException:
If this ProxyClient does not denote a JMX connector for a JMX VM agent.
isSslRmiStubback to summary
public boolean isSslRmiStub()

Returns true if the retrieved RMI stub is SSL-protected.

Exceptions
UnsupportedOperationException:
If this ProxyClient does not denote a JMX connector for a JMX VM agent.
isVmConnectorback to summary
public boolean isVmConnector()

Returns true if this ProxyClient denotes a JMX connector for a JMX VM agent.

markAsDeadback to summary
public synchronized void markAsDead()
removePropertyChangeListenerback to summary
public void removePropertyChangeListener(PropertyChangeListener listener)

Implements com.sun.tools.jconsole.JConsoleContext.removePropertyChangeListener.

Doc from com.sun.tools.jconsole.JConsoleContext.removePropertyChangeListener.

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.

setAttributeback to summary
public void setAttribute(ObjectName name, Attribute attribute) throws InvalidAttributeValueException, MBeanException, IOException

Set the value of a specific attribute of a named MBean.

setConnectionStateback to summary
private void setConnectionState(JConsoleContext.ConnectionState state)
setParametersback to summary
private void setParameters(JMXServiceURL url, String userName, String password)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

tryConnectback to summary
private void tryConnect(boolean requireRemoteSSL) throws IOException
sun.tools.jconsole back to summary

public Class ProxyClient.Snapshot

extends Object
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ProxyClient.SnapshotMBeanServerConnection
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Snapshotback to summary
private Snapshot()

Method Detail

newSnapshotback to summary
public static ProxyClient.SnapshotMBeanServerConnection newSnapshot(MBeanServerConnection mbsc)
sun.tools.jconsole back to summary

pack-priv Class ProxyClient.SnapshotInvocationHandler

extends Object
implements InvocationHandler
Class Inheritance
All Implemented Interfaces
java.lang.reflect.InvocationHandler

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private Map<ObjectName, Set<String>>
private Map<ObjectName, ProxyClient.SnapshotInvocationHandler.NameValueMap>
private final MBeanServerConnection

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv synchronized void
private Object
getAttribute(ObjectName objName, String attrName)

private AttributeList
getAttributes(ObjectName objName, String[] attrNames)

private synchronized ProxyClient.SnapshotInvocationHandler.NameValueMap
public Object
invoke(Object proxy, Method method, Object[] args)

Implements java.lang.reflect.InvocationHandler.invoke.

Processes a method invocation on a proxy instance and returns the result.

private static <K, V> Map<K, V>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cachedNamesback to summary
private Map<ObjectName, Set<String>> cachedNames
cachedValuesback to summary
private Map<ObjectName, ProxyClient.SnapshotInvocationHandler.NameValueMap> cachedValues
connback to summary
private final MBeanServerConnection conn

Constructor Detail

SnapshotInvocationHandlerback to summary
pack-priv SnapshotInvocationHandler(MBeanServerConnection conn)

Method Detail

flushback to summary
pack-priv synchronized void flush()
getAttributeback to summary
private Object getAttribute(ObjectName objName, String attrName) throws MBeanException, InstanceNotFoundException, AttributeNotFoundException, ReflectionException, IOException
getAttributesback to summary
private AttributeList getAttributes(ObjectName objName, String[] attrNames) throws InstanceNotFoundException, ReflectionException, IOException
getCachedAttributesback to summary
private synchronized ProxyClient.SnapshotInvocationHandler.NameValueMap getCachedAttributes(ObjectName objName, Set<String> attrNames) throws InstanceNotFoundException, ReflectionException, IOException
invokeback to summary
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable

Implements java.lang.reflect.InvocationHandler.invoke.

Doc from java.lang.reflect.InvocationHandler.invoke.

Processes a method invocation on a proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.

Exceptions
Throwable:
the exception to throw from the method invocation on the proxy instance. The exception's type must be assignable either to any of the exception types declared in the throws clause of the invoked method or to the unchecked exception types java.lang.RuntimeException or java.lang.Error. If a checked exception is thrown by this method that is not assignable to any of the exception types declared in the throws clause of the invoked method, then an UndeclaredThrowableException containing the exception that was thrown by this method will be thrown by the method invocation on the proxy instance.
newMapback to summary
private static <K, V> Map<K, V> newMap()
sun.tools.jconsole back to summary

private final Class ProxyClient.SnapshotInvocationHandler.NameValueMap

extends HashMap<String, Object>
Class Inheritance
Annotations
@SuppressWarnings:serial

Constructor Summary

AccessConstructor and Description
private

Constructor Detail

NameValueMapback to summary
private NameValueMap()
sun.tools.jconsole back to summary

public Interface ProxyClient.SnapshotMBeanServerConnection

extends MBeanServerConnection

Method Summary

Modifier and TypeMethod and Description
public void
flush()

Flush all cached values of attributes.

Inherited from javax.management.MBeanServerConnection:
addNotificationListeneraddNotificationListenercreateMBeancreateMBeancreateMBeancreateMBeangetAttributegetAttributesgetDefaultDomaingetDomainsgetMBeanCountgetMBeanInfogetObjectInstanceinvokeisInstanceOfisRegisteredqueryMBeansqueryNamesremoveNotificationListenerremoveNotificationListenerremoveNotificationListenerremoveNotificationListenersetAttributesetAttributesunregisterMBean

Method Detail

flushback to summary
public void flush()

Flush all cached values of attributes.

sun.tools.jconsole back to summary

private Class ProxyClient.WeakPCL

extends WeakReference<PropertyChangeListener>
implements PropertyChangeListener
Class Inheritance
All Implemented Interfaces
java.beans.PropertyChangeListener, java.util.EventListener

The PropertyChangeListener is handled via a WeakReference so as not to pin down the listener.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
public void
propertyChange(PropertyChangeEvent pce)

Implements java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

Constructor Detail

WeakPCLback to summary
pack-priv WeakPCL(PropertyChangeListener referent)

Method Detail

disposeback to summary
private void dispose()
propertyChangeback to summary
public void propertyChange(PropertyChangeEvent pce)

Implements java.beans.PropertyChangeListener.propertyChange.

Doc from java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.