APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.management.remote.rmi

public Class RMIConnector

extends Object
implements JMXConnector, Serializable, JMXAddressable
Class Inheritance
All Implemented Interfaces
javax.management.remote.JMXAddressable, java.io.Serializable, javax.management.remote.JMXConnector, java.io.Closeable, java.lang.AutoCloseable
Imports
com.sun.jmx.remote.internal.ClientCommunicatorAdmin, .ClientListenerInfo, .ClientNotifForwarder, com.sun.jmx.remote.internal.rmi.ProxyRef, com.sun.jmx.remote.util.ClassLogger, .EnvHelp, java.io.ByteArrayInputStream, .IOException, .InputStream, .InvalidObjectException, .ObjectInputStream, .ObjectStreamClass, .Serializable, .NotSerializableException, java.lang.module.ModuleDescriptor, java.lang.ref.WeakReference, java.lang.reflect.Constructor, .InvocationHandler, .InvocationTargetException, .Proxy, java.net.MalformedURLException, java.rmi.MarshalledObject, .NoSuchObjectException, .Remote, .ServerException, .UnmarshalException, java.rmi.server.RMIClientSocketFactory, .RemoteObject, .RemoteObjectInvocationHandler, .RemoteRef, java.security.ProtectionDomain, java.util.Arrays, .Collections, .HashMap, .Hashtable, .Map, .Objects, .Set, .WeakHashMap, java.util.stream.Collectors, javax.management.Attribute, .AttributeList, .AttributeNotFoundException, .InstanceAlreadyExistsException, .InstanceNotFoundException, .IntrospectionException, .InvalidAttributeValueException, .ListenerNotFoundException, .MBeanException, .MBeanInfo, .MBeanRegistrationException, .MBeanServerConnection, .MBeanServerDelegate, .MBeanServerNotification, .NotCompliantMBeanException, .Notification, .NotificationBroadcasterSupport, .NotificationFilter, .NotificationFilterSupport, .NotificationListener, .ObjectInstance, .ObjectName, .QueryExp, .ReflectionException, javax.management.remote.JMXConnectionNotification, .JMXConnector, .JMXConnectorFactory, .JMXServiceURL, .NotificationResult, .JMXAddressable, javax.naming.InitialContext, .NamingException, javax.rmi.ssl.SslRMIClientSocketFactory, javax.security.auth.Subject, jdk.internal.module.Modules, sun.rmi.server.UnicastRef2, sun.rmi.transport.LiveRef

A connection to a remote RMI connector. Usually, such connections are made using JMXConnectorFactory. However, specialized applications can use this class directly, for example with an RMIServer stub obtained without going through JNDI.

Since
1.5

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private class
private class
private class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final byte[]
base64ToInt

This array is a lookup table that translates unicode characters drawn from the "Base64 Alphabet" (as specified in Table 1 of RFC 2045) into their 6-bit positive integer equivalents.

private transient long
private transient long
private transient Exception
private transient ClientCommunicatorAdmin
private transient boolean
private transient RMIConnection
private transient NotificationBroadcasterSupport
private transient String
private transient ClassLoader
private transient Map<String, Object>
private final JMXServiceURL
private static final ClassLogger
private transient WeakReference<MBeanServerConnection>
private static final String
private static final Constructor<?>
private static final Class<?>
private static final String
private transient RMIConnector.RMINotifClient
private final RMIServer
private static final Class<?>
private static final String
private static final long
private transient boolean

Constructor Summary

AccessConstructor and Description
private
RMIConnector(RMIServer rmiServer, JMXServiceURL address, Map<String, ?> environment)

public
RMIConnector(JMXServiceURL
the address of the RMI connector server.
url
,
Map<String, ?>
additional attributes specifying how to make the connection. For JNDI-based addresses, these attributes can usefully include JNDI attributes recognized by InitialContext. This parameter can be null, which is equivalent to an empty Map.
environment
)

Constructs an RMIConnector that will connect the RMI connector server with the given address.

public
RMIConnector(RMIServer
an RMI stub representing the RMI connector server.
rmiServer
,
Map<String, ?>
additional attributes specifying how to make the connection. This parameter can be null, which is equivalent to an empty Map.
environment
)

Constructs an RMIConnector using the given RMI stub.

Method Summary

Modifier and TypeMethod and Description
public void
addConnectionNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)

Implements javax.management.remote.JMXConnector.addConnectionNotificationListener.

Adds a listener to be informed of changes in connection status.

private Integer[]
addListenersWithSubjects(ObjectName[] names, MarshalledObject<NotificationFilter>[] filters, Subject[] delegationSubjects, boolean reconnect)

private Integer
addListenerWithSubject(ObjectName name, MarshalledObject<NotificationFilter> filter, Subject delegationSubject, boolean reconnect)

private static byte[]
private static int
base64toInt(char c)

Translates the specified character, which is assumed to be in the "Base 64 Alphabet" into its equivalent 6-bit positive integer.

private static void
checkStub(Remote stub, Class<?> stubClass)

public synchronized void
close()

Implements javax.management.remote.JMXConnector.close.

Closes the client connection to its server.

private synchronized void
close(boolean intern)

public void
connect()

Implements javax.management.remote.JMXConnector.connect.

Establishes the connection to the connector server.

public synchronized void
connect(Map<String, ?> environment)

Implements javax.management.remote.JMXConnector.connect.

Establishes the connection to the connector server.

private RMIServer
findRMIServer(JMXServiceURL directoryURL, Map<String, Object> environment)

private RMIServer

Returns:

The retrieved RMIServer stub.
findRMIServerJNDI
(String
A JNDI URL indicating the location of the Stub (see javax.management.remote.rmi), e.g.:
  • rmi://registry-host:port/rmi-stub-name
  • or ldap://ldap-host:port/java-container-dn
jndiURL
,
Map<String, ?>
the environment Map passed to the connector.
env
)

Lookup the RMIServer stub in a directory.

private RMIServer
public JMXServiceURL

Returns:

the address of this connector, or null if it does not have one.
getAddress
()

Implements javax.management.remote.JMXAddressable.getAddress.

The address of this connector.

pack-priv static String
private MBeanServerConnection
private static RMIConnection
getConnection(RMIServer server, Object credentials, boolean checkStub)

public synchronized String
getConnectionId()

Implements javax.management.remote.JMXConnector.getConnectionId.

Gets this connection's ID from the connector server.

public synchronized MBeanServerConnection
getMBeanServerConnection()

Implements javax.management.remote.JMXConnector.getMBeanServerConnection.

Returns an MBeanServerConnection object representing a remote MBean server.

private void
private static RMIServer
private static String
objects(final Object[] objs)

private static String
private void
private ClassLoader
private void
readObject(ObjectInputStream
The ObjectInputStream to read from.
s
)

Read RMIConnector fields from an ObjectInputStream.

public void
removeConnectionNotificationListener(NotificationListener listener)

Implements javax.management.remote.JMXConnector.removeConnectionNotificationListener.

Removes a listener from the list to be informed of changes in status.

public void
removeConnectionNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)

Implements javax.management.remote.JMXConnector.removeConnectionNotificationListener.

Removes a listener from the list to be informed of changes in status.

private void
private static RMIConnection
private static String
strings(final String[] strs)

public String

Returns:

a String representation of this object.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this object.

private void
writeObject(ObjectOutputStream
The ObjectOutputStream to write to.
s
)

Writes the RMIConnector fields to an ObjectOutputStream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait