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


Java EnvHelp.mapToHashtable方法代码示例

本文整理汇总了Java中com.sun.jmx.remote.util.EnvHelp.mapToHashtable方法的典型用法代码示例。如果您正苦于以下问题:Java EnvHelp.mapToHashtable方法的具体用法?Java EnvHelp.mapToHashtable怎么用?Java EnvHelp.mapToHashtable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.jmx.remote.util.EnvHelp的用法示例。


在下文中一共展示了EnvHelp.mapToHashtable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findRMIServerJNDI

import com.sun.jmx.remote.util.EnvHelp; //导入方法依赖的package包/类
/**
 * Lookup the RMIServer stub in a directory.
 * @param jndiURL A JNDI URL indicating the location of the Stub
 *                (see {@link javax.management.remote.rmi}), e.g.:
 *   <ul><li><tt>rmi://registry-host:port/rmi-stub-name</tt></li>
 *       <li>or <tt>iiop://cosnaming-host:port/iiop-stub-name</tt></li>
 *       <li>or <tt>ldap://ldap-host:port/java-container-dn</tt></li>
 *   </ul>
 * @param env the environment Map passed to the connector.
 * @param isIiop true if the stub is expected to be an IIOP stub.
 * @return The retrieved RMIServer stub.
 * @exception NamingException if the stub couldn't be found.
 **/
private RMIServer findRMIServerJNDI(String jndiURL, Map<String, ?> env,
        boolean isIiop)
        throws NamingException {

    InitialContext ctx = new InitialContext(EnvHelp.mapToHashtable(env));

    Object objref = ctx.lookup(jndiURL);
    ctx.close();

    if (isIiop)
        return narrowIIOPServer(objref);
    else
        return narrowJRMPServer(objref);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:RMIConnector.java

示例2: mapToHashtableTests

import com.sun.jmx.remote.util.EnvHelp; //导入方法依赖的package包/类
private int mapToHashtableTests() {
    int errorCount = 0;
    echo("");
    echo(dashedMessage("Run MapToHashtable Tests"));
    for (int i = 0; i < maps.length; i++) {
        echo("\n>>> MapToHashtable Test [" + i + "]");
        try {
            echo("\tMap = " + maps[i]);
            Hashtable t = EnvHelp.mapToHashtable(maps[i]);
            echo("\tHashtable = " + t);
            checkContents(maps[i], t);
            echo("\tTest [" + i + "] PASSED!");
        } catch (Exception e) {
            errorCount++;
            echo("\tTest [" + i + "] FAILED!");
            e.printStackTrace(System.out);
        }
    }
    if (errorCount == 0) {
        echo("");
        echo(dashedMessage("MapToHashtable Tests PASSED!"));
    } else {
        echo("");
        echo(dashedMessage("MapToHashtable Tests FAILED!"));
    }
    return errorCount;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:28,代码来源:MapNullValuesTest.java

示例3: findRMIServerJNDI

import com.sun.jmx.remote.util.EnvHelp; //导入方法依赖的package包/类
/**
 * Lookup the RMIServer stub in a directory.
 * @param jndiURL A JNDI URL indicating the location of the Stub
 *                (see {@link javax.management.remote.rmi}), e.g.:
 *   <ul><li>{@code rmi://registry-host:port/rmi-stub-name}</li>
 *       <li>or {@code ldap://ldap-host:port/java-container-dn}</li>
 *   </ul>
 * @param env the environment Map passed to the connector.
 * @return The retrieved RMIServer stub.
 * @exception NamingException if the stub couldn't be found.
 **/
private RMIServer findRMIServerJNDI(String jndiURL, Map<String, ?> env)
        throws NamingException {

    InitialContext ctx = new InitialContext(EnvHelp.mapToHashtable(env));

    Object objref = ctx.lookup(jndiURL);
    ctx.close();

    return narrowJRMPServer(objref);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:RMIConnector.java


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