public JMXConnectorServer newJMXConnectorServer(JMXServiceURL url, Map<String,?> map, MBeanServer mbeanServer) throws IOException { final String protocol = url.getProtocol(); called = true; System.out.println("JMXConnectorServerProviderImpl called"); if(protocol.equals("rmi")) return new RMIConnectorServer(url, map, mbeanServer); if(protocol.equals("throw-provider-exception")) throw new JMXProviderException("I have been asked to throw"); throw new IllegalArgumentException("UNKNOWN PROTOCOL"); }
public JMXConnector newJMXConnector(JMXServiceURL url, Map<String,?> map) throws IOException { final String protocol = url.getProtocol(); called = true; System.out.println("JMXConnectorProviderImpl called"); if(protocol.equals("rmi")) return new RMIConnector(url, map); if(protocol.equals("throw-provider-exception")) throw new JMXProviderException("I have been asked to throw"); throw new IllegalArgumentException("UNKNOWN PROTOCOL"); }
private static Throwable makeThrowable(Random r, Throwable cause) { int exType = r.nextInt(4); switch(exType) { case 0: return new IllegalArgumentException("an illegal argument was passed", cause); case 1: return new Exception("this is a test", cause); case 2: return new JMXProviderException("jmx provider exception error occured", cause); case 3: return new OutOfMemoryError("ran out of memory"); } return null; }