本文整理匯總了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");
}