89 /*
90 * Export callback object and bind in registry.
91 */
92 System.err.println("export callback object and bind in registry");
93 obj = new CallbackImpl();
94 Callback proxy =
95 (Callback) UnicastRemoteObject.exportObject(obj, 0);
96 Registry registry =
97 LocateRegistry.createRegistry(
98 TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT);
99 registry.bind("Callback", proxy);
100
101 /*
102 * Start rmid.
103 */
104 System.err.println("start rmid with inherited channel");
105 RMID.removeLog();
106 rmid = RMID.createRMID(System.out, System.err, true, true,
107 TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT);
108 rmid.addOptions(
109 "-XaddExports:java.base/sun.nio.ch=ALL-UNNAMED",
110 "-Djava.nio.channels.spi.SelectorProvider=InheritedChannelNotServerSocket$SP");
111 rmid.start();
112
113 /*
114 * Get activation system and wait to be notified via callback
115 * from rmid's selector provider.
116 */
117 System.err.println("get activation system");
118 ActivationSystem system = ActivationGroup.getSystem();
119 System.err.println("ActivationSystem = " + system);
120 synchronized (lock) {
121 while (!notified) {
122 lock.wait();
123 }
124 }
125 System.err.println("TEST PASSED");
126 } finally {
127 if (obj != null) {
128 UnicastRemoteObject.unexportObject(obj, true);
129 }
|
89 /*
90 * Export callback object and bind in registry.
91 */
92 System.err.println("export callback object and bind in registry");
93 obj = new CallbackImpl();
94 Callback proxy =
95 (Callback) UnicastRemoteObject.exportObject(obj, 0);
96 Registry registry =
97 LocateRegistry.createRegistry(
98 TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT);
99 registry.bind("Callback", proxy);
100
101 /*
102 * Start rmid.
103 */
104 System.err.println("start rmid with inherited channel");
105 RMID.removeLog();
106 rmid = RMID.createRMID(System.out, System.err, true, true,
107 TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT);
108 rmid.addOptions(
109 "--add-exports=java.base/sun.nio.ch=ALL-UNNAMED",
110 "-Djava.nio.channels.spi.SelectorProvider=InheritedChannelNotServerSocket$SP");
111 rmid.start();
112
113 /*
114 * Get activation system and wait to be notified via callback
115 * from rmid's selector provider.
116 */
117 System.err.println("get activation system");
118 ActivationSystem system = ActivationGroup.getSystem();
119 System.err.println("ActivationSystem = " + system);
120 synchronized (lock) {
121 while (!notified) {
122 lock.wait();
123 }
124 }
125 System.err.println("TEST PASSED");
126 } finally {
127 if (obj != null) {
128 UnicastRemoteObject.unexportObject(obj, true);
129 }
|