當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。