use of sun.rmi.transport.proxy.RMIHttpToPortSocketFactory in project jdk8u_jdk by JetBrains.
the class HttpSocketTest method main.
public static void main(String[] args) throws Exception {
Registry registry = null;
TestLibrary.suggestSecurityManager(null);
// Set the socket factory.
System.err.println("installing socket factory");
RMISocketFactory.setSocketFactory(new RMIHttpToPortSocketFactory());
int registryPort = -1;
try {
System.err.println("Starting registry");
registry = TestLibrary.createRegistryOnUnusedPort();
registryPort = TestLibrary.getRegistryPort(registry);
} catch (Exception e) {
TestLibrary.bomb(e);
}
try {
registry.rebind(NAME, new HttpSocketTest());
MyRemoteInterface httpTest = (MyRemoteInterface) Naming.lookup("//:" + registryPort + "/" + NAME);
httpTest.setRemoteObject(new HttpSocketTest());
Remote r = httpTest.getRemoteObject();
} catch (Exception e) {
TestLibrary.bomb(e);
}
}
Aggregations