APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.management.jmxremote

public final Class ConnectorBootstrap

extends Object
Class Inheritance
Imports
java.lang.System.Logger, .System.Logger.Level, java.io.File, .FileInputStream, .IOException, .InputStream, .ObjectInputFilter, java.lang.management.ManagementFactory, java.net.InetAddress, .MalformedURLException, .Socket, .ServerSocket, .UnknownHostException, java.rmi.NoSuchObjectException, .Remote, .RemoteException, java.rmi.registry.Registry, java.rmi.server.RMIClientSocketFactory, .RMIServerSocketFactory, .RemoteObject, .UnicastRemoteObject, java.security.KeyStore, .Principal, java.util.HashMap, .HashSet, .Map, .Properties, .Set, .StringTokenizer, javax.management.MBeanServer, javax.management.remote.JMXAuthenticator, .JMXConnectorServer, .JMXConnectorServerFactory, .JMXServiceURL, javax.management.remote.rmi.RMIConnectorServer, javax.net.ssl.KeyManagerFactory, .SSLContext, .SSLSocket, .SSLSocketFactory, .TrustManagerFactory, javax.rmi.ssl.SslRMIClientSocketFactory, .SslRMIServerSocketFactory, javax.security.auth.Subject, com.sun.jmx.remote.internal.rmi.RMIExporter, com.sun.jmx.remote.security.JMXPluggableAuthenticator, jdk.internal.agent.Agent, .AgentConfigurationError, .ConnectorAddressLink, .FileSystem, sun.rmi.server.UnicastRef, .UnicastServerRef, .UnicastServerRef2, sun.rmi.transport.LiveRef

This class initializes and starts the RMIConnectorServer for JSR 163 JMX Monitoring.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
ConnectorBootstrap.AccessFileCheckerAuthenticator

This JMXAuthenticator wraps the JMXPluggableAuthenticator and verifies that at least one of the principal names contained in the authenticated Subject is present in the access file.

public static interface
ConnectorBootstrap.DefaultValues

Default values for JMX configuration properties.

private static class
private static class
private static class
ConnectorBootstrap.JMXConnectorServerData

JMXConnectorServer associated data.

private static class
ConnectorBootstrap.PermanentExporter

Prevents our RMI server objects from keeping the JVM alive.

public static interface
ConnectorBootstrap.PropertyNames

Names of JMX configuration properties.

private static class

Field Summary

Modifier and TypeField and Description
private static final System.Logger
private static Registry

Constructor Summary

AccessConstructor and Description
private
ConnectorBootstrap()

This class cannot be instantiated.

Method Summary

Modifier and TypeMethod and Description
private static void
checkAccessFile(String accessFileName)

private static void
checkPasswordFile(String passwordFileName)

private static void
checkRestrictedFile(String restrictedFileName)

private static void
config(String func, String msg)

private static void
private static void
config(String func, String msg, Throwable t)

private static SslRMIServerSocketFactory
createSslRMIServerSocketFactory(String sslConfigFileName, String[] enabledCipherSuites, String[] enabledProtocols, boolean sslNeedClientAuth, String bindAddress)

private static ConnectorBootstrap.JMXConnectorServerData
exportMBeanServer(MBeanServer mbs, int port, int rmiPort, boolean useSsl, boolean useRegistrySsl, String sslConfigFileName, String[] enabledCipherSuites, String[] enabledProtocols, boolean sslNeedClientAuth, boolean useAuthentication, String loginConfigName, String passwordFileName, boolean shouldHashPasswords, String accessFileName, String bindAddress, String jmxRmiFilter)

private static String

Returns:

${JRE}/conf/management/${basename}
getDefaultFileName
(String
basename (with extension) of the default file.
basename
)

Compute the full path name for a default file.

public static synchronized JMXConnectorServer
initialize()

Initializes and starts the JMX Connector Server.

public static synchronized JMXConnectorServer
initialize(String portStr, Properties props)

This method is used by some jtreg tests.

public static JMXConnectorServer
public static synchronized JMXConnectorServer
startRemoteConnectorServer(String portStr, Properties props)

Initializes and starts a JMX Connector Server for remote monitoring and management.

public static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

loggerback to summary
private static final System.Logger logger
registryback to summary
private static Registry registry

Constructor Detail

ConnectorBootstrapback to summary
private ConnectorBootstrap()

This class cannot be instantiated.

Method Detail

checkAccessFileback to summary
private static void checkAccessFile(String accessFileName)
checkPasswordFileback to summary
private static void checkPasswordFile(String passwordFileName)
checkRestrictedFileback to summary
private static void checkRestrictedFile(String restrictedFileName)
configback to summary
private static void config(String func, String msg)
configback to summary
private static void config(String func, Throwable t)
configback to summary
private static void config(String func, String msg, Throwable t)
createSslRMIServerSocketFactoryback to summary
private static SslRMIServerSocketFactory createSslRMIServerSocketFactory(String sslConfigFileName, String[] enabledCipherSuites, String[] enabledProtocols, boolean sslNeedClientAuth, String bindAddress)
exportMBeanServerback to summary
private static ConnectorBootstrap.JMXConnectorServerData exportMBeanServer(MBeanServer mbs, int port, int rmiPort, boolean useSsl, boolean useRegistrySsl, String sslConfigFileName, String[] enabledCipherSuites, String[] enabledProtocols, boolean sslNeedClientAuth, boolean useAuthentication, String loginConfigName, String passwordFileName, boolean shouldHashPasswords, String accessFileName, String bindAddress, String jmxRmiFilter) throws IOException, MalformedURLException
getDefaultFileNameback to summary
private static String getDefaultFileName(String basename)

Compute the full path name for a default file.

Parameters
basename:String

basename (with extension) of the default file.

Returns:String

${JRE}/conf/management/${basename}

initializeback to summary
public static synchronized JMXConnectorServer initialize()

Initializes and starts the JMX Connector Server. If the com.sun.management.jmxremote.port property is not defined, simply returns. Otherwise, attempts to load the config file, and then calls startRemoteConnectorServer(java.lang.String, java.util.Properties). This method is used by some jtreg tests.

initializeback to summary
public static synchronized JMXConnectorServer initialize(String portStr, Properties props)

This method is used by some jtreg tests.

See Also
startRemoteConnectorServer(String portStr, Properties props)
startLocalConnectorServerback to summary
public static JMXConnectorServer startLocalConnectorServer()
startRemoteConnectorServerback to summary
public static synchronized JMXConnectorServer startRemoteConnectorServer(String portStr, Properties props)

Initializes and starts a JMX Connector Server for remote monitoring and management.

unexportRegistryback to summary
public static void unexportRegistry()
sun.management.jmxremote back to summary

private Class ConnectorBootstrap.AccessFileCheckerAuthenticator

extends Object
implements JMXAuthenticator
Class Inheritance
  • java.lang.Object
  • sun.management.jmxremote.ConnectorBootstrap.AccessFileCheckerAuthenticator
All Implemented Interfaces
javax.management.remote.JMXAuthenticator

This JMXAuthenticator wraps the JMXPluggableAuthenticator and verifies that at least one of the principal names contained in the authenticated Subject is present in the access file.

Field Summary

Modifier and TypeField and Description
private final String
private final Map<String, Object>
private final Properties

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Subject
authenticate(Object credentials)

Implements javax.management.remote.JMXAuthenticator.authenticate.

Authenticates the MBeanServerConnection client with the given client credentials.

private void
private static Properties
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

accessFileback to summary
private final String accessFile
environmentback to summary
private final Map<String, Object> environment
propertiesback to summary
private final Properties properties

Constructor Detail

AccessFileCheckerAuthenticatorback to summary
public AccessFileCheckerAuthenticator(Map<String, Object> env) throws IOException

Method Detail

authenticateback to summary
public Subject authenticate(Object credentials)

Implements javax.management.remote.JMXAuthenticator.authenticate.

Doc from javax.management.remote.JMXAuthenticator.authenticate.

Authenticates the MBeanServerConnection client with the given client credentials.

checkAccessFileEntriesback to summary
private void checkAccessFileEntries(Subject subject)
propertiesFromFileback to summary
private static Properties propertiesFromFile(String fname) throws IOException
sun.management.jmxremote back to summary

public Interface ConnectorBootstrap.DefaultValues


Default values for JMX configuration properties.

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String

Field Detail

ACCESS_FILE_NAMEback to summary
public static final String ACCESS_FILE_NAME
CONFIG_FILE_NAMEback to summary
public static final String CONFIG_FILE_NAME
HASH_PASSWORDSback to summary
public static final String HASH_PASSWORDS
PASSWORD_FILE_NAMEback to summary
public static final String PASSWORD_FILE_NAME
PORTback to summary
public static final String PORT
SSL_NEED_CLIENT_AUTHback to summary
public static final String SSL_NEED_CLIENT_AUTH
USE_AUTHENTICATIONback to summary
public static final String USE_AUTHENTICATION
USE_LOCAL_ONLYback to summary
public static final String USE_LOCAL_ONLY
USE_REGISTRY_SSLback to summary
public static final String USE_REGISTRY_SSL
USE_SSLback to summary
public static final String USE_SSL
sun.management.jmxremote back to summary

private Class ConnectorBootstrap.HostAwareSocketFactory

extends Object
implements RMIServerSocketFactory
Class Inheritance
  • java.lang.Object
  • sun.management.jmxremote.ConnectorBootstrap.HostAwareSocketFactory
All Implemented Interfaces
java.rmi.server.RMIServerSocketFactory

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public ServerSocket
createServerSocket(int port)

Implements java.rmi.server.RMIServerSocketFactory.createServerSocket.

Create a server socket on the specified port (port 0 indicates an anonymous port).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bindAddressback to summary
private final String bindAddress

Constructor Detail

HostAwareSocketFactoryback to summary
private HostAwareSocketFactory(String bindAddress)

Method Detail

createServerSocketback to summary
public ServerSocket createServerSocket(int port) throws IOException

Implements java.rmi.server.RMIServerSocketFactory.createServerSocket.

Doc from java.rmi.server.RMIServerSocketFactory.createServerSocket.

Create a server socket on the specified port (port 0 indicates an anonymous port).

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs during server socket creation
sun.management.jmxremote back to summary

private Class ConnectorBootstrap.HostAwareSslSocketFactory

extends SslRMIServerSocketFactory
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final String
private final SSLContext

Constructor Summary

AccessConstructor and Description
private
HostAwareSslSocketFactory(String[] enabledCipherSuites, String[] enabledProtocols, boolean sslNeedClientAuth, String bindAddress)

private
HostAwareSslSocketFactory(SSLContext ctx, String[] enabledCipherSuites, String[] enabledProtocols, boolean sslNeedClientAuth, String bindAddress)

Method Summary

Modifier and TypeMethod and Description
private static void
checkValues(SSLContext context, String[] enabledCipherSuites, String[] enabledProtocols)

public ServerSocket
createServerSocket(int port)

Overrides javax.rmi.ssl.SslRMIServerSocketFactory.createServerSocket.

Implements java.rmi.server.RMIServerSocketFactory.createServerSocket.

Creates a server socket that accepts SSL connections configured according to this factory's SSL socket configuration parameters.

Inherited from javax.rmi.ssl.SslRMIServerSocketFactory:
equalsgetEnabledCipherSuitesgetEnabledProtocolsgetNeedClientAuthhashCode

Field Detail

bindAddressback to summary
private final String bindAddress
contextback to summary
private final SSLContext context

Hides javax.rmi.ssl.SslRMIServerSocketFactory.context.

Constructor Detail

HostAwareSslSocketFactoryback to summary
private HostAwareSslSocketFactory(String[] enabledCipherSuites, String[] enabledProtocols, boolean sslNeedClientAuth, String bindAddress) throws IllegalArgumentException
HostAwareSslSocketFactoryback to summary
private HostAwareSslSocketFactory(SSLContext ctx, String[] enabledCipherSuites, String[] enabledProtocols, boolean sslNeedClientAuth, String bindAddress) throws IllegalArgumentException

Method Detail

checkValuesback to summary
private static void checkValues(SSLContext context, String[] enabledCipherSuites, String[] enabledProtocols) throws IllegalArgumentException
createServerSocketback to summary
public ServerSocket createServerSocket(int port) throws IOException

Overrides javax.rmi.ssl.SslRMIServerSocketFactory.createServerSocket.

Implements java.rmi.server.RMIServerSocketFactory.createServerSocket.

Doc from javax.rmi.ssl.SslRMIServerSocketFactory.createServerSocket.

Creates a server socket that accepts SSL connections configured according to this factory's SSL socket configuration parameters.

Annotations
@Override
Exceptions
IOException:

Doc from java.rmi.server.RMIServerSocketFactory.createServerSocket.

if an I/O error occurs during server socket creation

sun.management.jmxremote back to summary

private Class ConnectorBootstrap.JMXConnectorServerData

extends Object
Class Inheritance
  • java.lang.Object
  • sun.management.jmxremote.ConnectorBootstrap.JMXConnectorServerData

JMXConnectorServer associated data.

Field Summary

Modifier and TypeField and Description
pack-priv JMXConnectorServer
pack-priv JMXServiceURL

Constructor Summary

AccessConstructor and Description
public
JMXConnectorServerData(JMXConnectorServer jmxConnectorServer, JMXServiceURL jmxRemoteURL)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

jmxConnectorServerback to summary
pack-priv JMXConnectorServer jmxConnectorServer
jmxRemoteURLback to summary
pack-priv JMXServiceURL jmxRemoteURL

Constructor Detail

JMXConnectorServerDataback to summary
public JMXConnectorServerData(JMXConnectorServer jmxConnectorServer, JMXServiceURL jmxRemoteURL)
sun.management.jmxremote back to summary

private Class ConnectorBootstrap.PermanentExporter

extends Object
implements RMIExporter
Class Inheritance
  • java.lang.Object
  • sun.management.jmxremote.ConnectorBootstrap.PermanentExporter
All Implemented Interfaces
com.sun.jmx.remote.internal.rmi.RMIExporter

Prevents our RMI server objects from keeping the JVM alive.

We use a private interface in Sun's JMX Remote API implementation that allows us to specify how to export RMI objects. We do so using UnicastServerRef, a class in Sun's RMI implementation. This is all non-portable, of course, so this is only valid because we are inside Sun's JRE.

Objects are exported using UnicastServerRef#exportObject(Remote, Object, boolean). The boolean parameter is called permanent and means both that the object is not eligible for Distributed Garbage Collection, and that its continued existence will not prevent the JVM from exiting. It is the latter semantics we want (we already have the former because of the way the JMX Remote API works). Hence the somewhat misleading name of this class.

Field Summary

Modifier and TypeField and Description
pack-priv Remote

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Remote
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

firstExportedback to summary
pack-priv Remote firstExported

Constructor Detail

PermanentExporterback to summary
private PermanentExporter()

Method Detail

exportObjectback to summary
public Remote exportObject(Remote obj, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf, ObjectInputFilter filter) throws RemoteException

Implements com.sun.jmx.remote.internal.rmi.RMIExporter.exportObject.

unexportObjectback to summary
public boolean unexportObject(Remote obj, boolean force) throws NoSuchObjectException

Implements com.sun.jmx.remote.internal.rmi.RMIExporter.unexportObject.

sun.management.jmxremote back to summary

public Interface ConnectorBootstrap.PropertyNames


Names of JMX configuration properties.

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String

Field Detail

ACCESS_FILE_NAMEback to summary
public static final String ACCESS_FILE_NAME
CONFIG_FILE_NAMEback to summary
public static final String CONFIG_FILE_NAME
HASH_PASSWORDSback to summary
public static final String HASH_PASSWORDS
HOSTback to summary
public static final String HOST
LOCAL_PORTback to summary
public static final String LOCAL_PORT
LOGIN_CONFIG_NAMEback to summary
public static final String LOGIN_CONFIG_NAME
PASSWORD_FILE_NAMEback to summary
public static final String PASSWORD_FILE_NAME
PORTback to summary
public static final String PORT
RMI_PORTback to summary
public static final String RMI_PORT
SERIAL_FILTER_PATTERNback to summary
public static final String SERIAL_FILTER_PATTERN
SSL_CONFIG_FILE_NAMEback to summary
public static final String SSL_CONFIG_FILE_NAME
SSL_ENABLED_CIPHER_SUITESback to summary
public static final String SSL_ENABLED_CIPHER_SUITES
SSL_ENABLED_PROTOCOLSback to summary
public static final String SSL_ENABLED_PROTOCOLS
SSL_NEED_CLIENT_AUTHback to summary
public static final String SSL_NEED_CLIENT_AUTH
USE_AUTHENTICATIONback to summary
public static final String USE_AUTHENTICATION
USE_LOCAL_ONLYback to summary
public static final String USE_LOCAL_ONLY
USE_REGISTRY_SSLback to summary
public static final String USE_REGISTRY_SSL
USE_SSLback to summary
public static final String USE_SSL
sun.management.jmxremote back to summary

private Class ConnectorBootstrap.SslServerSocket

extends ServerSocket
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final SSLContext
private static SSLSocketFactory
private final String[]
private final String[]
private final boolean

Constructor Summary

AccessConstructor and Description
private
SslServerSocket(int port, SSLContext ctx, String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth)

private
SslServerSocket(int port, int backlog, InetAddress bindAddr, SSLContext ctx, String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth)

Method Summary

Modifier and TypeMethod and Description
public Socket
accept()

Overrides java.net.ServerSocket.accept.

Listens for a connection to be made to this socket and accepts it.

private static synchronized SSLSocketFactory
Inherited from java.net.ServerSocket:
bindbindclosegetChannelgetInetAddressgetLocalPortgetLocalSocketAddressgetOptiongetReceiveBufferSizegetReuseAddressgetSoTimeoutimplAcceptisBoundisClosedsetOptionsetPerformancePreferencessetReceiveBufferSizesetReuseAddresssetSocketFactorysetSoTimeoutsupportedOptionstoString

Field Detail

contextback to summary
private final SSLContext context
defaultSSLSocketFactoryback to summary
private static SSLSocketFactory defaultSSLSocketFactory
enabledCipherSuitesback to summary
private final String[] enabledCipherSuites
enabledProtocolsback to summary
private final String[] enabledProtocols
needClientAuthback to summary
private final boolean needClientAuth

Constructor Detail

SslServerSocketback to summary
private SslServerSocket(int port, SSLContext ctx, String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth) throws IOException
SslServerSocketback to summary
private SslServerSocket(int port, int backlog, InetAddress bindAddr, SSLContext ctx, String[] enabledCipherSuites, String[] enabledProtocols, boolean needClientAuth) throws IOException

Method Detail

acceptback to summary
public Socket accept() throws IOException

Overrides java.net.ServerSocket.accept.

Doc from java.net.ServerSocket.accept.

Listens for a connection to be made to this socket and accepts it. The method blocks until a connection is made.

This method is interruptible in the following circumstances:

  1. The socket is associated with a ServerSocketChannel. In that case, interrupting a thread accepting a connection will close the underlying channel and cause this method to throw java.nio.channels.ClosedByInterruptException with the thread's interrupted status set.
  2. The socket uses the system-default socket implementation and a virtual thread is accepting a connection. In that case, interrupting the virtual thread will cause it to wakeup and close the socket. This method will then throw SocketException with the thread's interrupted status set.
Annotations
@Override
Exceptions
IOException:
if an I/O error occurs when waiting for a connection, the socket is not bound or the socket is closed.
getDefaultSSLSocketFactoryback to summary
private static synchronized SSLSocketFactory getDefaultSSLSocketFactory()