本文整理汇总了Java中javax.management.remote.JMXServiceURL.getProtocol方法的典型用法代码示例。如果您正苦于以下问题:Java JMXServiceURL.getProtocol方法的具体用法?Java JMXServiceURL.getProtocol怎么用?Java JMXServiceURL.getProtocol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.management.remote.JMXServiceURL
的用法示例。
在下文中一共展示了JMXServiceURL.getProtocol方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newJMXConnectorServer
import javax.management.remote.JMXServiceURL; //导入方法依赖的package包/类
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);
}
示例2: newJMXConnector
import javax.management.remote.JMXServiceURL; //导入方法依赖的package包/类
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);
}
示例3: newJMXConnectorServer
import javax.management.remote.JMXServiceURL; //导入方法依赖的package包/类
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);
}
示例4: newJMXConnector
import javax.management.remote.JMXServiceURL; //导入方法依赖的package包/类
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);
}
示例5: isIiopURL
import javax.management.remote.JMXServiceURL; //导入方法依赖的package包/类
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;
}
示例6: newJMXConnector
import javax.management.remote.JMXServiceURL; //导入方法依赖的package包/类
@Override
public JMXConnector newJMXConnector(final JMXServiceURL url, final Map<String, ?> environment)
throws MalformedURLException {
final String protocol = url.getProtocol();
if (!SimpleJmx.PROTOCOL.equals(protocol)) {
throw new MalformedURLException(
"Invalid protocol '" + protocol + "' for provider " + this.getClass().getName());
}
return new ClientConnector(url, environment);
}
示例7: newJMXConnectorServer
import javax.management.remote.JMXServiceURL; //导入方法依赖的package包/类
@Override
public JMXConnectorServer newJMXConnectorServer(final JMXServiceURL url, final Map<String, ?> environment,
final MBeanServer server) throws MalformedURLException {
final String protocol = url.getProtocol();
if (!SimpleJmx.PROTOCOL.equals(protocol)) {
throw new MalformedURLException(
"Invalid protocol '" + protocol + "' for provider " + this.getClass().getName());
}
return new ServerConnector(url, environment, server);
}
示例8: updateAddress
import javax.management.remote.JMXServiceURL; //导入方法依赖的package包/类
void updateAddress(final int localPort) {
try {
url = new JMXServiceURL(url.getProtocol(), url.getHost(), localPort);
} catch (final MalformedURLException e) {
LOGGER.log(Level.INFO, "Could not update url in JMXConnectorServer to reflect bound port", e);
}
}
示例9: newJMXConnectorServer
import javax.management.remote.JMXServiceURL; //导入方法依赖的package包/类
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");
}
示例10: newJMXConnector
import javax.management.remote.JMXServiceURL; //导入方法依赖的package包/类
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");
}