jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation3Test.java
changeset 16109 eb00701a5769
parent 5506 202f599c92aa
child 23010 6dadb192ad81
equal deleted inserted replaced
16108:e5fcdadc69b2 16109:eb00701a5769
   118             // Register the SimpleStandardMBean
   118             // Register the SimpleStandardMBean
   119             //
   119             //
   120             System.out.println("Create SimpleStandard MBean");
   120             System.out.println("Create SimpleStandard MBean");
   121             SimpleStandard s = new SimpleStandard("delegate");
   121             SimpleStandard s = new SimpleStandard("delegate");
   122             mbs.registerMBean(s, new ObjectName("MBeans:type=SimpleStandard"));
   122             mbs.registerMBean(s, new ObjectName("MBeans:type=SimpleStandard"));
   123             // Set Security Manager
       
   124             //
       
   125             System.setSecurityManager(new SecurityManager());
       
   126             // Create Properties containing the username/password entries
   123             // Create Properties containing the username/password entries
   127             //
   124             //
   128             Properties props = new Properties();
   125             Properties props = new Properties();
   129             props.setProperty("jmx.remote.x.password.file", passwordFile);
   126             props.setProperty("jmx.remote.x.password.file", passwordFile);
   130             // Initialize environment map to be passed to the connector server
   127             // Initialize environment map to be passed to the connector server
   131             //
   128             //
   132             System.out.println("Initialize environment map");
   129             System.out.println("Initialize environment map");
   133             HashMap env = new HashMap();
   130             HashMap env = new HashMap();
   134             env.put("jmx.remote.authenticator",
   131             env.put("jmx.remote.authenticator",
   135                     new JMXPluggableAuthenticator(props));
   132                     new JMXPluggableAuthenticator(props));
       
   133             // Set Security Manager
       
   134             //
       
   135             System.setSecurityManager(new SecurityManager());
   136             // Create an RMI connector server
   136             // Create an RMI connector server
   137             //
   137             //
   138             System.out.println("Create an RMI connector server");
   138             System.out.println("Create an RMI connector server");
   139             JMXServiceURL url =
   139             JMXServiceURL url =
   140                 new JMXServiceURL("rmi", null, 0,
   140                 new JMXServiceURL("rmi", null, 0,