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


Java CorbaUtils.remoteToCorba方法代码示例

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


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

示例1: getStateToBind

import com.sun.jndi.toolkit.corba.CorbaUtils; //导入方法依赖的package包/类
/**
 * Returns the CORBA object for a Remote object.
 * If input is not a Remote object, or if Remote object uses JRMP, return null.
 * If the RMI-IIOP library is not available, throw ConfigurationException.
 *
 * @param orig The object to turn into a CORBA object. If not Remote,
 *             or if is a JRMP stub or impl, return null.
 * @param name Ignored
 * @param ctx The non-null CNCtx whose ORB to use.
 * @param env Ignored
 * @return The CORBA object for <tt>orig</tt> or null.
 * @exception ConfigurationException If the CORBA object cannot be obtained
 *    due to configuration problems, for instance, if RMI-IIOP not available.
 * @exception NamingException If some other problem prevented a CORBA
 *    object from being obtained from the Remote object.
 */
public Object getStateToBind(Object orig, Name name, Context ctx,
    Hashtable<?,?> env) throws NamingException {
    if (orig instanceof org.omg.CORBA.Object) {
        // Already a CORBA object, just use it
        return null;
    }

    if (orig instanceof Remote) {
        // Turn remote object into org.omg.CORBA.Object
        try {
            // Returns null if JRMP; let next factory try
            // CNCtx will eventually throw IllegalArgumentException if
            // no CORBA object gotten
            return
                CorbaUtils.remoteToCorba((Remote)orig, ((CNCtx)ctx)._orb);
        } catch (ClassNotFoundException e) {
            // RMI-IIOP library not available
            throw new ConfigurationException(
                "javax.rmi packages not available");
        }
    }
    return null; // pass and let next state factory try
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:40,代码来源:RemoteToCorba.java

示例2: getStateToBind

import com.sun.jndi.toolkit.corba.CorbaUtils; //导入方法依赖的package包/类
/**
 * Returns the CORBA object for a Remote object.
 * If input is not a Remote object, or if Remote object uses JRMP, return null.
 * If the RMI-IIOP library is not available, throw ConfigurationException.
 *
 * @param orig The object to turn into a CORBA object. If not Remote,
 *             or if is a JRMP stub or impl, return null.
 * @param name Ignored
 * @param ctx The non-null CNCtx whose ORB to use.
 * @param env Ignored
 * @return The CORBA object for {@code orig} or null.
 * @exception ConfigurationException If the CORBA object cannot be obtained
 *    due to configuration problems, for instance, if RMI-IIOP not available.
 * @exception NamingException If some other problem prevented a CORBA
 *    object from being obtained from the Remote object.
 */
public Object getStateToBind(Object orig, Name name, Context ctx,
    Hashtable<?,?> env) throws NamingException {
    if (orig instanceof org.omg.CORBA.Object) {
        // Already a CORBA object, just use it
        return null;
    }

    if (orig instanceof Remote) {
        // Turn remote object into org.omg.CORBA.Object
        // Returns null if JRMP; let next factory try
        // CNCtx will eventually throw IllegalArgumentException if
        // no CORBA object gotten
        return CorbaUtils.remoteToCorba((Remote)orig, ((CNCtx)ctx)._orb);
    }
    return null; // pass and let next state factory try
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:33,代码来源:RemoteToCorba.java


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