Java Code Examples for javax.management.remote.JMXServiceURL#getProtocol()

The following examples show how to use javax.management.remote.JMXServiceURL#getProtocol() . 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: RMIConnectorServer.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
static boolean isIiopURL(JMXServiceURL directoryURL, boolean strict)
    throws MalformedURLException {
    String protocol = directoryURL.getProtocol();
    if (protocol.equals("rmi"))
        return false;
    else if (protocol.equals("iiop"))
        return true;
    else if (strict) {

        throw new MalformedURLException("URL must have protocol " +
                                        "\"rmi\" or \"iiop\": \"" +
                                        protocol + "\"");
    }
    return false;
}
 
Example 2
Source File: ServerProvider.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public JMXConnectorServer newJMXConnectorServer(JMXServiceURL serviceURL,
                                                Map<String,?> environment,
                                                MBeanServer mbeanServer)
        throws IOException {
    if (!serviceURL.getProtocol().equals("rmi")) {
        throw new MalformedURLException("Protocol not rmi: " +
                                        serviceURL.getProtocol());
    }
    return new RMIConnectorServer(serviceURL, environment, mbeanServer);
}
 
Example 3
Source File: JMXConnectorServerProviderImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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");
}
 
Example 4
Source File: JMXConnectorProviderImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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");
}
 
Example 5
Source File: ClientProvider.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public JMXConnector newJMXConnector(JMXServiceURL serviceURL,
                                    Map<String,?> environment)
        throws IOException {
    if (!serviceURL.getProtocol().equals("iiop")) {
        throw new MalformedURLException("Protocol not iiop: " +
                                        serviceURL.getProtocol());
    }
    return new RMIConnector(serviceURL, environment);
}
 
Example 6
Source File: JMXConnectorServerProviderImpl.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
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");
}
 
Example 7
Source File: JMXConnectorServerProviderImpl.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
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");
}
 
Example 8
Source File: JMXConnectorServerProviderImpl.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
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");
}
 
Example 9
Source File: ServerProvider.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public JMXConnectorServer newJMXConnectorServer(JMXServiceURL serviceURL,
                                                Map<String,?> environment,
                                                MBeanServer mbeanServer)
        throws IOException {
    if (!serviceURL.getProtocol().equals("rmi")) {
        throw new MalformedURLException("Protocol not rmi: " +
                                        serviceURL.getProtocol());
    }
    return new RMIConnectorServer(serviceURL, environment, mbeanServer);
}
 
Example 10
Source File: JMXConnectorProviderImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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");
}
 
Example 11
Source File: ClientProvider.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public JMXConnector newJMXConnector(JMXServiceURL serviceURL,
                                    Map<String,?> environment)
        throws IOException {
    if (!serviceURL.getProtocol().equals("iiop")) {
        throw new MalformedURLException("Protocol not iiop: " +
                                        serviceURL.getProtocol());
    }
    return new RMIConnector(serviceURL, environment);
}
 
Example 12
Source File: ServerProvider.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public JMXConnectorServer newJMXConnectorServer(JMXServiceURL serviceURL,
                                                Map<String,?> environment,
                                                MBeanServer mbeanServer)
        throws IOException {
    if (!serviceURL.getProtocol().equals("rmi")) {
        throw new MalformedURLException("Protocol not rmi: " +
                                        serviceURL.getProtocol());
    }
    return new RMIConnectorServer(serviceURL, environment, mbeanServer);
}
 
Example 13
Source File: ServerProvider.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public JMXConnectorServer newJMXConnectorServer(JMXServiceURL serviceURL,
                                                Map<String,?> environment,
                                                MBeanServer mbeanServer)
        throws IOException {
    if (!serviceURL.getProtocol().equals("iiop")) {
        throw new MalformedURLException("Protocol not iiop: " +
                                        serviceURL.getProtocol());
    }
    return new RMIConnectorServer(serviceURL, environment, mbeanServer);
}
 
Example 14
Source File: ServerProvider.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public JMXConnectorServer newJMXConnectorServer(JMXServiceURL serviceURL,
                                                Map<String,?> environment,
                                                MBeanServer mbeanServer)
        throws IOException {
    if (!serviceURL.getProtocol().equals("rmi")) {
        throw new MalformedURLException("Protocol not rmi: " +
                                        serviceURL.getProtocol());
    }
    return new RMIConnectorServer(serviceURL, environment, mbeanServer);
}
 
Example 15
Source File: JMXConnectorServerProviderImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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");
}
 
Example 16
Source File: ServerProvider.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public JMXConnectorServer newJMXConnectorServer(JMXServiceURL serviceURL,
                                                Map<String,?> environment,
                                                MBeanServer mbeanServer)
        throws IOException {
    if (!serviceURL.getProtocol().equals("iiop")) {
        throw new MalformedURLException("Protocol not iiop: " +
                                        serviceURL.getProtocol());
    }
    return new RMIConnectorServer(serviceURL, environment, mbeanServer);
}
 
Example 17
Source File: ClientProvider.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public JMXConnector newJMXConnector(JMXServiceURL serviceURL,
                                    Map<String,?> environment)
        throws IOException {
    if (!serviceURL.getProtocol().equals("rmi")) {
        throw new MalformedURLException("Protocol not rmi: " +
                                        serviceURL.getProtocol());
    }
    return new RMIConnector(serviceURL, environment);
}
 
Example 18
Source File: ClientProvider.java    From scheduling with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * @see javax.management.remote.JMXConnectorProvider#newJMXConnector(JMXServiceURL, Map)
 */
public JMXConnector newJMXConnector(final JMXServiceURL serviceURL, final Map<String, ?> env) throws IOException {
    final String protocol = serviceURL.getProtocol();
    if (!JMXProviderUtils.RO_PROTOCOL.equals(protocol)) {
        throw new MalformedURLException("Wrong protocol " + protocol + " for provider " + this);
    }
    return new ROConnector(serviceURL, env);
}
 
Example 19
Source File: RMIConnectorServer.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
static boolean isIiopURL(JMXServiceURL directoryURL, boolean strict)
    throws MalformedURLException {
    String protocol = directoryURL.getProtocol();
    if (protocol.equals("rmi"))
        return false;
    else if (protocol.equals("iiop"))
        return true;
    else if (strict) {

        throw new MalformedURLException("URL must have protocol " +
                                        "\"rmi\" or \"iiop\": \"" +
                                        protocol + "\"");
    }
    return false;
}
 
Example 20
Source File: ClientProvider.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public JMXConnector newJMXConnector(JMXServiceURL serviceURL,
                                    Map<String,?> environment)
        throws IOException {
    if (!serviceURL.getProtocol().equals("rmi")) {
        throw new MalformedURLException("Protocol not rmi: " +
                                        serviceURL.getProtocol());
    }
    return new RMIConnector(serviceURL, environment);
}