本文整理汇总了Java中javax.management.remote.JMXServiceURL.getURLPath方法的典型用法代码示例。如果您正苦于以下问题:Java JMXServiceURL.getURLPath方法的具体用法?Java JMXServiceURL.getURLPath怎么用?Java JMXServiceURL.getURLPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.management.remote.JMXServiceURL
的用法示例。
在下文中一共展示了JMXServiceURL.getURLPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getText
import javax.management.remote.JMXServiceURL; //导入方法依赖的package包/类
@Override
public String getText(Object element) {
JmxConnectionModel model = (JmxConnectionModel) element;
if (model.getOwner() == null) {
return model.getKey().getName();
}
else {
JMXServiceURL jmxServiceURL = model.getKey().getJmxServiceUrl();
String host = jmxServiceURL.getHost();
String urlPath = jmxServiceURL.getURLPath();
if ((host != null && !host.isEmpty()) || urlPath == null) {
return String.valueOf(jmxServiceURL);
}
else {
return urlPath;
}
}
}
示例2: findRMIServer
import javax.management.remote.JMXServiceURL; //导入方法依赖的package包/类
private RMIServer findRMIServer(JMXServiceURL directoryURL,
Map<String, Object> environment)
throws NamingException, IOException {
final boolean isIiop = RMIConnectorServer.isIiopURL(directoryURL,true);
if (isIiop) {
// Make sure java.naming.corba.orb is in the Map.
environment.put(EnvHelp.DEFAULT_ORB,resolveOrb(environment));
}
String path = directoryURL.getURLPath();
int end = path.indexOf(';');
if (end < 0) end = path.length();
if (path.startsWith("/jndi/"))
return findRMIServerJNDI(path.substring(6,end), environment, isIiop);
else if (path.startsWith("/stub/"))
return findRMIServerJRMP(path.substring(6,end), environment, isIiop);
else if (path.startsWith("/ior/")) {
if (!IIOPHelper.isAvailable())
throw new IOException("iiop protocol not available");
return findRMIServerIIOP(path.substring(5,end), environment, isIiop);
} else {
final String msg = "URL path must begin with /jndi/ or /stub/ " +
"or /ior/: " + path;
throw new MalformedURLException(msg);
}
}
示例3: findRMIServer
import javax.management.remote.JMXServiceURL; //导入方法依赖的package包/类
private RMIServer findRMIServer(JMXServiceURL directoryURL,
Map<String, Object> environment)
throws NamingException, IOException {
String path = directoryURL.getURLPath();
int end = path.indexOf(';');
if (end < 0) end = path.length();
if (path.startsWith("/jndi/"))
return findRMIServerJNDI(path.substring(6,end), environment);
else if (path.startsWith("/stub/"))
return findRMIServerJRMP(path.substring(6,end), environment);
else {
final String msg = "URL path must begin with /jndi/ or /stub/ " +
"or /ior/: " + path;
throw new MalformedURLException(msg);
}
}