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


Java IIOPHelper类代码示例

本文整理汇总了Java中com.sun.jmx.remote.internal.IIOPHelper的典型用法代码示例。如果您正苦于以下问题:Java IIOPHelper类的具体用法?Java IIOPHelper怎么用?Java IIOPHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IIOPHelper类属于com.sun.jmx.remote.internal包,在下文中一共展示了IIOPHelper类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findRMIServer

import com.sun.jmx.remote.internal.IIOPHelper; //导入依赖的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

示例2: encodeStubInAddress

import com.sun.jmx.remote.internal.IIOPHelper; //导入依赖的package包/类
/**
 * Encode a stub into the JMXServiceURL.
 * @param rmiServer The stub object to encode in the URL
 * @param attributes A Map containing environment parameters,
 *        built from the Map specified at this object creation.
 **/
private void encodeStubInAddress(
        RMIServer rmiServer, Map<String, ?> attributes)
        throws IOException {

    final String protocol, host;
    final int port;

    if (address == null) {
        if (IIOPHelper.isStub(rmiServer))
            protocol = "iiop";
        else
            protocol = "rmi";
        host = null; // will default to local host name
        port = 0;
    } else {
        protocol = address.getProtocol();
        host = (address.getHost().equals("")) ? null : address.getHost();
        port = address.getPort();
    }

    final String urlPath = encodeStub(rmiServer, attributes);

    address = new JMXServiceURL(protocol, host, port, urlPath);
}
 
开发者ID:Java8-CNAPI-Team,项目名称:Java8CN,代码行数:31,代码来源:RMIConnectorServer.java

示例3: encodeStub

import com.sun.jmx.remote.internal.IIOPHelper; //导入依赖的package包/类
/**
 * Returns the IOR of the given rmiServer.
 **/
static String encodeStub(
        RMIServer rmiServer, Map<String, ?> env) throws IOException {
    if (IIOPHelper.isStub(rmiServer))
        return "/ior/" + encodeIIOPStub(rmiServer, env);
    else
        return "/stub/" + encodeJRMPStub(rmiServer, env);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:RMIConnectorServer.java

示例4: encodeIIOPStub

import com.sun.jmx.remote.internal.IIOPHelper; //导入依赖的package包/类
static String encodeIIOPStub(
        RMIServer rmiServer, Map<String, ?> env)
        throws IOException {
    try {
        Object orb = IIOPHelper.getOrb(rmiServer);
        return IIOPHelper.objectToString(orb, rmiServer);
    } catch (RuntimeException x) {
        throw newIOException(x.getMessage(), x);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:RMIConnectorServer.java

示例5: toStub

import com.sun.jmx.remote.internal.IIOPHelper; //导入依赖的package包/类
/**
 * <p>Returns an IIOP stub.</p>
 * The stub might not yet be connected to the ORB. The stub will
 * be serializable only if it is connected to the ORB.
 * @return an IIOP stub.
 * @exception IOException if the stub cannot be created - e.g the
 *            RMIIIOPServerImpl has not been exported yet.
 **/
public Remote toStub() throws IOException {
    // javax.rmi.CORBA.Stub stub =
    //    (javax.rmi.CORBA.Stub) PortableRemoteObject.toStub(this);
    final Remote stub = IIOPHelper.toStub(this);
    // java.lang.System.out.println("NON CONNECTED STUB " + stub);
    // org.omg.CORBA.ORB orb =
    //    org.omg.CORBA.ORB.init((String[])null, (Properties)null);
    // stub.connect(orb);
    // java.lang.System.out.println("CONNECTED STUB " + stub);
    return stub;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:RMIIIOPServerImpl.java

示例6: narrowIIOPServer

import com.sun.jmx.remote.internal.IIOPHelper; //导入依赖的package包/类
private static RMIServer narrowIIOPServer(Object objref) {
    try {
        return IIOPHelper.narrow(objref, RMIServer.class);
    } catch (ClassCastException e) {
        if (logger.traceOn())
            logger.trace("narrowIIOPServer","Failed to narrow objref=" +
                    objref + ": " + e);
        if (logger.debugOn()) logger.debug("narrowIIOPServer",e);
        return null;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:RMIConnector.java

示例7: shadowIiopStub

import com.sun.jmx.remote.internal.IIOPHelper; //导入依赖的package包/类
private static RMIConnection shadowIiopStub(Object stub)
throws InstantiationException, IllegalAccessException {
    Object proxyStub = null;
    try {
        proxyStub = AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
            public Object run() throws Exception {
                return proxyStubClass.newInstance();
            }
        });
    } catch (PrivilegedActionException e) {
        throw new InternalError();
    }
    IIOPHelper.setDelegate(proxyStub, IIOPHelper.getDelegate(stub));
    return (RMIConnection) proxyStub;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:RMIConnector.java


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