Java Code Examples for java.rmi.server.ExportException#getCause()
The following examples show how to use
java.rmi.server.ExportException#getCause() .
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: Server.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public static String start() throws Exception { int serverPort = 12345; ObjectName name = new ObjectName("test", "foo", "bar"); MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer(); SteMBean bean = new Ste(); jmxServer.registerMBean(bean, name); boolean exported = false; Random rnd = new Random(System.currentTimeMillis()); do { try { LocateRegistry.createRegistry(serverPort); exported = true; } catch (ExportException ee) { if (ee.getCause() instanceof BindException) { serverPort = rnd.nextInt(10000) + 4096; } else { throw ee; } } } while (!exported); JMXServiceURL serverUrl = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + serverPort + "/test"); JMXConnectorServer jmxConnector = JMXConnectorServerFactory.newJMXConnectorServer(serverUrl, null, jmxServer); jmxConnector.start(); return serverUrl.toString(); }
Example 2
Source File: Server.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public static String start() throws Exception { int serverPort = 12345; ObjectName name = new ObjectName("test", "foo", "bar"); MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer(); SteMBean bean = new Ste(); jmxServer.registerMBean(bean, name); boolean exported = false; Random rnd = new Random(System.currentTimeMillis()); do { try { LocateRegistry.createRegistry(serverPort); exported = true; } catch (ExportException ee) { if (ee.getCause() instanceof BindException) { serverPort = rnd.nextInt(10000) + 4096; } else { throw ee; } } } while (!exported); JMXServiceURL serverUrl = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + serverPort + "/test"); JMXConnectorServer jmxConnector = JMXConnectorServerFactory.newJMXConnectorServer(serverUrl, null, jmxServer); jmxConnector.start(); return serverUrl.toString(); }
Example 3
Source File: Server.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public static String start() throws Exception { int serverPort = 12345; ObjectName name = new ObjectName("test", "foo", "bar"); MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer(); SteMBean bean = new Ste(); jmxServer.registerMBean(bean, name); boolean exported = false; Random rnd = new Random(System.currentTimeMillis()); do { try { LocateRegistry.createRegistry(serverPort); exported = true; } catch (ExportException ee) { if (ee.getCause() instanceof BindException) { serverPort = rnd.nextInt(10000) + 4096; } else { throw ee; } } } while (!exported); JMXServiceURL serverUrl = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + serverPort + "/test"); JMXConnectorServer jmxConnector = JMXConnectorServerFactory.newJMXConnectorServer(serverUrl, null, jmxServer); jmxConnector.start(); return serverUrl.toString(); }
Example 4
Source File: Server.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public static String start() throws Exception { int serverPort = 12345; ObjectName name = new ObjectName("test", "foo", "bar"); MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer(); SteMBean bean = new Ste(); jmxServer.registerMBean(bean, name); boolean exported = false; Random rnd = new Random(System.currentTimeMillis()); do { try { LocateRegistry.createRegistry(serverPort); exported = true; } catch (ExportException ee) { if (ee.getCause() instanceof BindException) { serverPort = rnd.nextInt(10000) + 4096; } else { throw ee; } } } while (!exported); JMXServiceURL serverUrl = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + serverPort + "/test"); JMXConnectorServer jmxConnector = JMXConnectorServerFactory.newJMXConnectorServer(serverUrl, null, jmxServer); jmxConnector.start(); return serverUrl.toString(); }
Example 5
Source File: Server.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public static String start() throws Exception { int serverPort = 12345; ObjectName name = new ObjectName("test", "foo", "bar"); MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer(); SteMBean bean = new Ste(); jmxServer.registerMBean(bean, name); boolean exported = false; Random rnd = new Random(System.currentTimeMillis()); do { try { LocateRegistry.createRegistry(serverPort); exported = true; } catch (ExportException ee) { if (ee.getCause() instanceof BindException) { serverPort = rnd.nextInt(10000) + 4096; } else { throw ee; } } } while (!exported); JMXServiceURL serverUrl = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + serverPort + "/test"); JMXConnectorServer jmxConnector = JMXConnectorServerFactory.newJMXConnectorServer(serverUrl, null, jmxServer); jmxConnector.start(); return serverUrl.toString(); }
Example 6
Source File: Server.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public static String start() throws Exception { int serverPort = 12345; ObjectName name = new ObjectName("test", "foo", "bar"); MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer(); SteMBean bean = new Ste(); jmxServer.registerMBean(bean, name); boolean exported = false; Random rnd = new Random(System.currentTimeMillis()); do { try { LocateRegistry.createRegistry(serverPort); exported = true; } catch (ExportException ee) { if (ee.getCause() instanceof BindException) { serverPort = rnd.nextInt(10000) + 4096; } else { throw ee; } } } while (!exported); JMXServiceURL serverUrl = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + serverPort + "/test"); JMXConnectorServer jmxConnector = JMXConnectorServerFactory.newJMXConnectorServer(serverUrl, null, jmxServer); jmxConnector.start(); return serverUrl.toString(); }
Example 7
Source File: Server.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
public static String start() throws Exception { int serverPort = 12345; ObjectName name = new ObjectName("test", "foo", "bar"); MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer(); SteMBean bean = new Ste(); jmxServer.registerMBean(bean, name); boolean exported = false; Random rnd = new Random(System.currentTimeMillis()); do { try { LocateRegistry.createRegistry(serverPort); exported = true; } catch (ExportException ee) { if (ee.getCause() instanceof BindException) { serverPort = rnd.nextInt(10000) + 4096; } else { throw ee; } } } while (!exported); JMXServiceURL serverUrl = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + serverPort + "/test"); JMXConnectorServer jmxConnector = JMXConnectorServerFactory.newJMXConnectorServer(serverUrl, null, jmxServer); jmxConnector.start(); return serverUrl.toString(); }
Example 8
Source File: Server.java From hottub with GNU General Public License v2.0 | 5 votes |
public static String start() throws Exception { int serverPort = 12345; ObjectName name = new ObjectName("test", "foo", "bar"); MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer(); SteMBean bean = new Ste(); jmxServer.registerMBean(bean, name); boolean exported = false; Random rnd = new Random(System.currentTimeMillis()); do { try { LocateRegistry.createRegistry(serverPort); exported = true; } catch (ExportException ee) { if (ee.getCause() instanceof BindException) { serverPort = rnd.nextInt(10000) + 4096; } else { throw ee; } } } while (!exported); JMXServiceURL serverUrl = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + serverPort + "/test"); JMXConnectorServer jmxConnector = JMXConnectorServerFactory.newJMXConnectorServer(serverUrl, null, jmxServer); jmxConnector.start(); return serverUrl.toString(); }
Example 9
Source File: Server.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public static String start() throws Exception { int serverPort = 12345; ObjectName name = new ObjectName("test", "foo", "bar"); MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer(); SteMBean bean = new Ste(); jmxServer.registerMBean(bean, name); boolean exported = false; Random rnd = new Random(System.currentTimeMillis()); do { try { LocateRegistry.createRegistry(serverPort); exported = true; } catch (ExportException ee) { if (ee.getCause() instanceof BindException) { serverPort = rnd.nextInt(10000) + 4096; } else { throw ee; } } } while (!exported); JMXServiceURL serverUrl = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + serverPort + "/test"); JMXConnectorServer jmxConnector = JMXConnectorServerFactory.newJMXConnectorServer(serverUrl, null, jmxServer); jmxConnector.start(); return serverUrl.toString(); }
Example 10
Source File: Server.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public static String start() throws Exception { int serverPort = 12345; ObjectName name = new ObjectName("test", "foo", "bar"); MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer(); SteMBean bean = new Ste(); jmxServer.registerMBean(bean, name); boolean exported = false; Random rnd = new Random(System.currentTimeMillis()); do { try { LocateRegistry.createRegistry(serverPort); exported = true; } catch (ExportException ee) { if (ee.getCause() instanceof BindException) { serverPort = rnd.nextInt(10000) + 4096; } else { throw ee; } } } while (!exported); JMXServiceURL serverUrl = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + serverPort + "/test"); JMXConnectorServer jmxConnector = JMXConnectorServerFactory.newJMXConnectorServer(serverUrl, null, jmxServer); jmxConnector.start(); return serverUrl.toString(); }
Example 11
Source File: Server.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
public static String start() throws Exception { int serverPort = 12345; ObjectName name = new ObjectName("test", "foo", "bar"); MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer(); SteMBean bean = new Ste(); jmxServer.registerMBean(bean, name); boolean exported = false; Random rnd = new Random(System.currentTimeMillis()); do { try { LocateRegistry.createRegistry(serverPort); exported = true; } catch (ExportException ee) { if (ee.getCause() instanceof BindException) { serverPort = rnd.nextInt(10000) + 4096; } else { throw ee; } } } while (!exported); JMXServiceURL serverUrl = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + serverPort + "/test"); JMXConnectorServer jmxConnector = JMXConnectorServerFactory.newJMXConnectorServer(serverUrl, null, jmxServer); jmxConnector.start(); return serverUrl.toString(); }
Example 12
Source File: Server.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
public static String start() throws Exception { int serverPort = 12345; ObjectName name = new ObjectName("test", "foo", "bar"); MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer(); SteMBean bean = new Ste(); jmxServer.registerMBean(bean, name); boolean exported = false; Random rnd = new Random(System.currentTimeMillis()); do { try { LocateRegistry.createRegistry(serverPort); exported = true; } catch (ExportException ee) { if (ee.getCause() instanceof BindException) { serverPort = rnd.nextInt(10000) + 4096; } else { throw ee; } } } while (!exported); JMXServiceURL serverUrl = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + serverPort + "/test"); JMXConnectorServer jmxConnector = JMXConnectorServerFactory.newJMXConnectorServer(serverUrl, null, jmxServer); jmxConnector.start(); return serverUrl.toString(); }
Example 13
Source File: Server.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
public static String start() throws Exception { int serverPort = 12345; ObjectName name = new ObjectName("test", "foo", "bar"); MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer(); SteMBean bean = new Ste(); jmxServer.registerMBean(bean, name); boolean exported = false; Random rnd = new Random(System.currentTimeMillis()); do { try { LocateRegistry.createRegistry(serverPort); exported = true; } catch (ExportException ee) { if (ee.getCause() instanceof BindException) { serverPort = rnd.nextInt(10000) + 4096; } else { throw ee; } } } while (!exported); JMXServiceURL serverUrl = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + serverPort + "/test"); JMXConnectorServer jmxConnector = JMXConnectorServerFactory.newJMXConnectorServer(serverUrl, null, jmxServer); jmxConnector.start(); return serverUrl.toString(); }