Java Code Examples for java.rmi.activation.ActivationGroup#getSystem()
The following examples show how to use
java.rmi.activation.ActivationGroup#getSystem() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InheritedChannelNotServerSocket.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.err.println("\nRegression test for bug 6261402\n"); System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new CallbackImpl(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = TestLibrary.createRegistryOnEphemeralPort(); int registryPort = TestLibrary.getRegistryPort(registry); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, true, TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT); rmid.addOptions( "--add-exports=java.base/sun.nio.ch=ALL-UNNAMED", "-Djava.nio.channels.spi.SelectorProvider=InheritedChannelNotServerSocket$SP", "-Dtest.java.rmi.rmidViaInheritedChannel.registry.port=" + registryPort); rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } if (rmid != null) { rmid.cleanup(); } } }
Example 2
Source File: RmidViaInheritedChannel.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new RmidViaInheritedChannel(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, false, TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"}); if (System.getProperty("os.name").startsWith("Windows") && System.getProperty("os.version").startsWith("5.")) { /* Windows XP/2003 or older * Need to expand ephemeral range to include RMI test ports */ rmid.addOptions(new String[]{ "-Djdk.net.ephemeralPortRange.low=1024", "-Djdk.net.ephemeralPortRange.high=64000" }); } rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 3
Source File: InheritedChannelNotServerSocket.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.err.println("\nRegression test for bug 6261402\n"); System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new CallbackImpl(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, true, TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=" + "InheritedChannelNotServerSocket$SP"}); rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 4
Source File: RmidViaInheritedChannel.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new RmidViaInheritedChannel(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, false, TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"}); if (System.getProperty("os.name").startsWith("Windows") && System.getProperty("os.version").startsWith("5.")) { /* Windows XP/2003 or older * Need to expand ephemeral range to include RMI test ports */ rmid.addOptions(new String[]{ "-Djdk.net.ephemeralPortRange.low=1024", "-Djdk.net.ephemeralPortRange.high=64000" }); } rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 5
Source File: InheritedChannelNotServerSocket.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.err.println("\nRegression test for bug 6261402\n"); System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new CallbackImpl(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, true, TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=" + "InheritedChannelNotServerSocket$SP"}); rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 6
Source File: RmidViaInheritedChannel.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new RmidViaInheritedChannel(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, false, TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"}); if (System.getProperty("os.name").startsWith("Windows") && System.getProperty("os.version").startsWith("5.")) { /* Windows XP/2003 or older * Need to expand ephemeral range to include RMI test ports */ rmid.addOptions(new String[]{ "-Djdk.net.ephemeralPortRange.low=1024", "-Djdk.net.ephemeralPortRange.high=64000" }); } rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 7
Source File: InheritedChannelNotServerSocket.java From hottub with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.err.println("\nRegression test for bug 6261402\n"); System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new CallbackImpl(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, true, TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=" + "InheritedChannelNotServerSocket$SP"}); rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 8
Source File: RmidViaInheritedChannel.java From hottub with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new RmidViaInheritedChannel(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, false, TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"}); if (System.getProperty("os.name").startsWith("Windows") && System.getProperty("os.version").startsWith("5.")) { /* Windows XP/2003 or older * Need to expand ephemeral range to include RMI test ports */ rmid.addOptions(new String[]{ "-Djdk.net.ephemeralPortRange.low=1024", "-Djdk.net.ephemeralPortRange.high=64000" }); } rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 9
Source File: InheritedChannelNotServerSocket.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.err.println("\nRegression test for bug 6261402\n"); System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new CallbackImpl(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, true, TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=" + "InheritedChannelNotServerSocket$SP"}); rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 10
Source File: RmidViaInheritedChannel.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new RmidViaInheritedChannel(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, false, TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"}); if (System.getProperty("os.name").startsWith("Windows") && System.getProperty("os.version").startsWith("5.")) { /* Windows XP/2003 or older * Need to expand ephemeral range to include RMI test ports */ rmid.addOptions(new String[]{ "-Djdk.net.ephemeralPortRange.low=1024", "-Djdk.net.ephemeralPortRange.high=64000" }); } rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 11
Source File: InheritedChannelNotServerSocket.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.err.println("\nRegression test for bug 6261402\n"); System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new CallbackImpl(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, true, TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=" + "InheritedChannelNotServerSocket$SP"}); rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 12
Source File: InheritedChannelNotServerSocket.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.err.println("\nRegression test for bug 6261402\n"); System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new CallbackImpl(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, true, TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=" + "InheritedChannelNotServerSocket$SP"}); rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 13
Source File: RmidViaInheritedChannel.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new RmidViaInheritedChannel(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, false, TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"}); if (System.getProperty("os.name").startsWith("Windows") && System.getProperty("os.version").startsWith("5.")) { /* Windows XP/2003 or older * Need to expand ephemeral range to include RMI test ports */ rmid.addOptions(new String[]{ "-Djdk.net.ephemeralPortRange.low=1024", "-Djdk.net.ephemeralPortRange.high=64000" }); } rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 14
Source File: RmidViaInheritedChannel.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new RmidViaInheritedChannel(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, false, TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"}); if (System.getProperty("os.name").startsWith("Windows") && System.getProperty("os.version").startsWith("5.")) { /* Windows XP/2003 or older * Need to expand ephemeral range to include RMI test ports */ rmid.addOptions(new String[]{ "-Djdk.net.ephemeralPortRange.low=1024", "-Djdk.net.ephemeralPortRange.high=64000" }); } rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 15
Source File: RmidViaInheritedChannel.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new RmidViaInheritedChannel(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, false, TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"}); if (System.getProperty("os.name").startsWith("Windows") && System.getProperty("os.version").startsWith("5.")) { /* Windows XP/2003 or older * Need to expand ephemeral range to include RMI test ports */ rmid.addOptions(new String[]{ "-Djdk.net.ephemeralPortRange.low=1024", "-Djdk.net.ephemeralPortRange.high=64000" }); } rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 16
Source File: InheritedChannelNotServerSocket.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.err.println("\nRegression test for bug 6261402\n"); System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new CallbackImpl(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, true, TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=" + "InheritedChannelNotServerSocket$SP"}); rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 17
Source File: RmidViaInheritedChannel.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new RmidViaInheritedChannel(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, false, TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"}); if (System.getProperty("os.name").startsWith("Windows") && System.getProperty("os.version").startsWith("5.")) { /* Windows XP/2003 or older * Need to expand ephemeral range to include RMI test ports */ rmid.addOptions(new String[]{ "-Djdk.net.ephemeralPortRange.low=1024", "-Djdk.net.ephemeralPortRange.high=64000" }); } rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 18
Source File: InheritedChannelNotServerSocket.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.err.println("\nRegression test for bug 6261402\n"); System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new CallbackImpl(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, true, TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=" + "InheritedChannelNotServerSocket$SP"}); rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 19
Source File: RmidViaInheritedChannel.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new RmidViaInheritedChannel(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, false, TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"}); if (System.getProperty("os.name").startsWith("Windows") && System.getProperty("os.version").startsWith("5.")) { /* Windows XP/2003 or older * Need to expand ephemeral range to include RMI test ports */ rmid.addOptions(new String[]{ "-Djdk.net.ephemeralPortRange.low=1024", "-Djdk.net.ephemeralPortRange.high=64000" }); } rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }
Example 20
Source File: InheritedChannelNotServerSocket.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
public static void main(String[] args) throws Exception { System.err.println("\nRegression test for bug 6261402\n"); System.setProperty("java.rmi.activation.port", Integer.toString(TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new CallbackImpl(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj, 0); Registry registry = LocateRegistry.createRegistry( TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT); registry.bind("Callback", proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out, System.err, true, true, TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=" + "InheritedChannelNotServerSocket$SP"}); rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj, true); } ActivationLibrary.rmidCleanup(rmid); } }