当前位置: 首页>>代码示例>>Java>>正文


Java JMXServiceURL.getURLPath方法代码示例

本文整理汇总了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;
        }

    }

}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:22,代码来源:JmxConnectionModelElementType.java

示例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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:RMIConnector.java

示例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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:RMIConnector.java


注:本文中的javax.management.remote.JMXServiceURL.getURLPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。