src/java.management.rmi/share/classes/javax/management/remote/rmi/package.html
changeset 55120 b0513c833960
parent 47216 71c04702a3d5
equal deleted inserted replaced
55119:04ff1e00635a 55120:b0513c833960
     1 <html>
     1 <html>
     2 <head>
     2 <head>
     3     <title>RMI connector</title>
     3     <title>RMI connector</title>
     4 <!--
     4 <!--
     5 Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
     5 Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
     6 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     6 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     7 
     7 
     8 This code is free software; you can redistribute it and/or modify it
     8 This code is free software; you can redistribute it and/or modify it
     9 under the terms of the GNU General Public License version 2 only, as
     9 under the terms of the GNU General Public License version 2 only, as
    10 published by the Free Software Foundation.  Oracle designates this
    10 published by the Free Software Foundation.  Oracle designates this
    67     </ul>
    67     </ul>
    68 
    68 
    69     <p>Addresses are covered in more detail below.</p>
    69     <p>Addresses are covered in more detail below.</p>
    70 
    70 
    71 
    71 
    72     <h3>Creating an RMI connector server</h3>
    72     <h2>Creating an RMI connector server</h2>
    73 
    73 
    74     <p>The usual way to create an RMI connector server is to supply an
    74     <p>The usual way to create an RMI connector server is to supply an
    75       RMI connector address to the method {@link
    75       RMI connector address to the method {@link
    76       javax.management.remote.JMXConnectorServerFactory#newJMXConnectorServer
    76       javax.management.remote.JMXConnectorServerFactory#newJMXConnectorServer
    77       JMXConnectorServerFactory.newJMXConnectorServer}.  The MBean
    77       JMXConnectorServerFactory.newJMXConnectorServer}.  The MBean
    84       instance of {@link
    84       instance of {@link
    85       javax.management.remote.rmi.RMIConnectorServer
    85       javax.management.remote.rmi.RMIConnectorServer
    86       RMIConnectorServer}, explicitly or through the MBean server's
    86       RMIConnectorServer}, explicitly or through the MBean server's
    87       <code>createMBean</code> method.</p>
    87       <code>createMBean</code> method.</p>
    88 
    88 
    89     <h4>Choosing the RMI transport</h4>
    89     <h3>Choosing the RMI transport</h3>
    90 
    90 
    91     <p>You can choose the RMI transport by specifying
    91     <p>You can choose the RMI transport by specifying
    92       <code>rmi</code> in the <code><em>protocol</em></code> part of the
    92       <code>rmi</code> in the <code><em>protocol</em></code> part of the
    93       <code>serviceURL</code> when creating the connector server.  You
    93       <code>serviceURL</code> when creating the connector server.  You
    94       can also create specialized connector servers by instantiating
    94       can also create specialized connector servers by instantiating
    96       javax.management.remote.rmi.RMIServerImpl RMIServerImpl} and
    96       javax.management.remote.rmi.RMIServerImpl RMIServerImpl} and
    97       supplying it to the <code>RMIConnectorServer</code>
    97       supplying it to the <code>RMIConnectorServer</code>
    98       constructor.</p>
    98       constructor.</p>
    99 
    99 
   100 
   100 
   101     <h4><a id="servergen">Connector addresses generated by the
   101     <h3><a id="servergen">Connector addresses generated by the
   102 	server</a></h4>
   102 	server</a></h3>
   103 
   103 
   104     <p>If the <code>serviceURL</code> you specify has an empty URL
   104     <p>If the <code>serviceURL</code> you specify has an empty URL
   105       path (after the optional host and port), or if you do not
   105       path (after the optional host and port), or if you do not
   106       specify a <code>serviceURL</code>, then the connector server
   106       specify a <code>serviceURL</code>, then the connector server
   107       will fabricate a new <code>JMXServiceURL</code> that clients can
   107       will fabricate a new <code>JMXServiceURL</code> that clients can
   155       <code>JMXServiceURL</code> will have the local host name in its
   155       <code>JMXServiceURL</code> will have the local host name in its
   156       <code><em>host</em></code> part and no
   156       <code><em>host</em></code> part and no
   157       <code><em>port</em></code>.</p>
   157       <code><em>port</em></code>.</p>
   158 
   158 
   159 
   159 
   160     <h4><a id="directory">Connector addresses based on directory
   160     <h3><a id="directory">Connector addresses based on directory
   161 	entries</a></h4>
   161 	entries</a></h3>
   162 
   162 
   163     <p>As an alternative to the generated addresses just described,
   163     <p>As an alternative to the generated addresses just described,
   164       the <code>serviceURL</code> address supplied when creating a
   164       the <code>serviceURL</code> address supplied when creating a
   165       connector server can specify a <em>directory address</em> in
   165       connector server can specify a <em>directory address</em> in
   166       which to store the provided or generated <code>RMIServer</code>
   166       which to store the provided or generated <code>RMIServer</code>
   262     <p>However, it is good practice to use the name of the host
   262     <p>However, it is good practice to use the name of the host
   263       where the connector server is running.  This is often different
   263       where the connector server is running.  This is often different
   264       from the name of the directory host.</p>
   264       from the name of the directory host.</p>
   265 
   265 
   266 
   266 
   267     <h4>Connector server attributes</h4>
   267     <h3>Connector server attributes</h3>
   268 
   268 
   269     <p>When using the default JRMP transport, RMI socket factories can
   269     <p>When using the default JRMP transport, RMI socket factories can
   270       be specified using the attributes
   270       be specified using the attributes
   271       <code>jmx.remote.rmi.client.socket.factory</code> and
   271       <code>jmx.remote.rmi.client.socket.factory</code> and
   272       <code>jmx.remote.rmi.server.socket.factory</code> in the
   272       <code>jmx.remote.rmi.server.socket.factory</code> in the
   276       java.rmi.server.RMIClientSocketFactory} and {@link
   276       java.rmi.server.RMIClientSocketFactory} and {@link
   277       java.rmi.server.RMIServerSocketFactory}, respectively.  These
   277       java.rmi.server.RMIServerSocketFactory}, respectively.  These
   278       factories are used when creating the RMI objects associated with
   278       factories are used when creating the RMI objects associated with
   279       the connector.</p>
   279       the connector.</p>
   280 
   280 
   281     <h3>Creating an RMI connector client</h3>
   281     <h2>Creating an RMI connector client</h2>
   282 
   282 
   283     <p>An RMI connector client is usually constructed using {@link
   283     <p>An RMI connector client is usually constructed using {@link
   284       javax.management.remote.JMXConnectorFactory}, with a
   284       javax.management.remote.JMXConnectorFactory}, with a
   285       <code>JMXServiceURL</code> that has <code>rmi</code> as its protocol.</p>
   285       <code>JMXServiceURL</code> that has <code>rmi</code> as its protocol.</p>
   286 
   286 
   309       javax.management.remote.rmi.RMIServer RMIServer}, you can
   309       javax.management.remote.rmi.RMIServer RMIServer}, you can
   310       construct an RMI connection directly by using the appropriate
   310       construct an RMI connection directly by using the appropriate
   311       constructor of {@link javax.management.remote.rmi.RMIConnector
   311       constructor of {@link javax.management.remote.rmi.RMIConnector
   312       RMIConnector}.</p>
   312       RMIConnector}.</p>
   313 
   313 
   314     <h3>Dynamic code downloading</h3>
   314     <h2>Dynamic code downloading</h2>
   315 
   315 
   316     <p>If an RMI connector client or server receives from its peer an
   316     <p>If an RMI connector client or server receives from its peer an
   317       instance of a class that it does not know, and if dynamic code
   317       instance of a class that it does not know, and if dynamic code
   318       downloading is active for the RMI connection, then the class can
   318       downloading is active for the RMI connection, then the class can
   319       be downloaded from a codebase specified by the peer.
   319       be downloaded from a codebase specified by the peer.