Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4949174

Clarify what RMIConnectorServer.getAttributes() should/could return

XMLWordPrintable

      Name: skR10005 Date: 11/05/2003


      The method RMIConnectorServer.getAttributes() returns Map which does not contain
      JNDI_REBIND_ATTRIBUTE attribute in case this attribute is not set explicitly.

      JMX Remote API 1.0 Specification (Summary of Environment Parameters) reads:
        "In TABLE 7-1, each parameter is defined by the following characteristics:
         * The name after the initial "jmx.remote." string
         * The type that the associated value must have
         * Whether the parameter applies to connector clients, to connector servers, or both
         * For server parameters, whether the parameter is visible, that is whether it
           appears in the Map returned by JMXConnectorServerMBean.getAttributes()"

      jmx.remote.jndi.rebind parameter has the following characteristics:
        * jndi.rebind
        * String
        * Server
        * Yes
        
      The last characteristic means that this parameter should appear in the Map returned
      by getAttributes() method.

      The following test shows that this parameter is absent.
      See below the test source and the execution log:

      ---test.java--------------------------------------------------------------------
      import javax.management.*;
      import javax.management.remote.*;
      import javax.management.remote.rmi.*;

      public class test {
          public static void main(String[] argv) {
              RMIConnectorServer rcs = null;
              try {
                  MBeanServer mbs = MBeanServerFactory.newMBeanServer();
                  JMXServiceURL url = new JMXServiceURL("service:jmx:iiop://localhost:0/jndi/iiop://@iiop-host@:@iiop-port@/aname");
                  rcs = new RMIConnectorServer(url, null, mbs);
                  System.out.println("Attribute present:" +
                      rcs.getAttributes().containsKey(RMIConnectorServer.JNDI_REBIND_ATTRIBUTE));
              } catch (Throwable thr) {
                  System.out.println(thr.toString());
              }
          }
      }
      --------------------------------------------------------------------------------

      ---Execution log----------------------------------------------------------------
      $ java -version
      java version "1.5.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b26)
      Java HotSpot(TM) Server VM (build 1.5.0-beta-b26, mixed mode)
      $ javac -d . test.java
      $ java -cp . test
      Attribute present:false
      $
      --------------------------------------------------------------------------------

      ======================================================================

            kevinw Kevin Walls
            serjsunw Serj Serj (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: