提交 8120c89b 编写于 作者: U uvangapally

8186998: Improve JMX supportive features

Summary: Improve JMX supportive features
Reviewed-by: mchung, dfuchs, rriggs, hb, skoivu, rhalade
上级 5dfc9d1c
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -46,7 +46,7 @@ import sun.rmi.registry.RegistryImpl;
public class SingleEntryRegistry extends RegistryImpl {
SingleEntryRegistry(int port, String name, Remote object)
throws RemoteException {
super(port);
super(port, null, null, SingleEntryRegistry::singleRegistryFilter);
this.name = name;
this.object = object;
}
......
......@@ -170,7 +170,7 @@ public class RegistryImpl extends java.rmi.server.RemoteServer
}
} else {
LiveRef lref = new LiveRef(id, port, csf, ssf);
setup(new UnicastServerRef2(lref, RegistryImpl::registryFilter));
setup(new UnicastServerRef2(lref, serialFilter));
}
}
......
......@@ -44,14 +44,37 @@ import java.util.HashSet;
* This tests the SingleEntryRegistry implemented by JMX.
* This test is a manual test and uses JMX running on a *different* host.
* JMX can be enabled in any Java runtime; for example:
* login or ssh to the different host and invoke rmiregistry with arguments below.
*
* Note: Use remote host with latest JDK update release for invoking rmiregistry.
*
* Note: Test should be ran twice once using arg1 and once using arg2.
*
* login or ssh to the remote host and invoke rmiregistry with arg1.
* It will not show any output.
* {@code $JDK_HOME/bin/rmiregistry \
* Execute the test, after test completes execution, stop the server.
*
* repeat above step using arg2 and execute the test.
*
*
* arg1: {@code $JDK_HOME/bin/rmiregistry \
* -J-Dcom.sun.management.jmxremote.port=8888 \
* -J-Dcom.sun.management.jmxremote.local.only=false \
* -J-Dcom.sun.management.jmxremote.ssl=false \
* -J-Dcom.sun.management.jmxremote.authenticate=false
* }
*
*
* replace "jmx-registry-host" with the hostname or IP address of the remote host
* for property "-J-Dcom.sun.management.jmxremote.host" below.
*
* arg2: {@code $JDK_HOME/bin/rmiregistry \
* -J-Dcom.sun.management.jmxremote.port=8888 \
* -J-Dcom.sun.management.jmxremote.local.only=false \
* -J-Dcom.sun.management.jmxremote.ssl=false \
* -J-Dcom.sun.management.jmxremote.authenticate=false \
* -J-Dcom.sun.management.jmxremote.host="jmx-registry-host"
* }
*
* On the first host modify the @run command above to replace "jmx-registry-host"
* with the hostname or IP address of the different host and run the test with jtreg.
*/
......@@ -132,6 +155,7 @@ public class NonLocalJMXRemoteTest {
if (asIndex < 0 ||
disallowIndex < 0 ||
nonLocalHostIndex < 0 ) {
System.out.println("Exception message is " + msg);
throw new RuntimeException("exception message is malformed", t);
}
System.out.printf("Found expected AccessException: %s%n%n", t);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册