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


Java ORBUtility.throwNotSerializableForCorba方法代码示例

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


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

示例1: writeAny

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
/**
 * Writes any java.lang.Object as a CORBA any.
 * @param out the stream in which to write the any.
 * @param obj the object to write as an any.
 */
public void writeAny( org.omg.CORBA.portable.OutputStream out,
                     java.lang.Object obj)
{
    org.omg.CORBA.ORB orb = out.orb();

    // Create Any
    Any any = orb.create_any();

    // Make sure we have a connected object...
    java.lang.Object newObj = Utility.autoConnect(obj,orb,false);

    if (newObj instanceof org.omg.CORBA.Object) {
        any.insert_Object((org.omg.CORBA.Object)newObj);
    } else {
        if (newObj == null) {
            // Handle the null case, including backwards
            // compatibility issues
            any.insert_Value(null, createTypeCodeForNull(orb));
        } else {
            if (newObj instanceof Serializable) {
                // If they're our Any and ORB implementations,
                // we may want to do type code related versioning.
                TypeCode tc = createTypeCode((Serializable)newObj, any, orb);
                if (tc == null)
                    any.insert_Value((Serializable)newObj);
                else
                    any.insert_Value((Serializable)newObj, tc);
            } else if (newObj instanceof Remote) {
                ORBUtility.throwNotSerializableForCorba(newObj.getClass().getName());
            } else {
                ORBUtility.throwNotSerializableForCorba(newObj.getClass().getName());
            }
        }
    }

    out.write_any(any);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:43,代码来源:Util.java

示例2: write_abstract_interface

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
public final void write_abstract_interface(java.lang.Object obj) {

        boolean isCorbaObject = false; // Assume value type.
        org.omg.CORBA.Object theCorbaObject = null;

        // Is it a CORBA.Object?
        if (obj != null && obj instanceof org.omg.CORBA.Object) {
            theCorbaObject = (org.omg.CORBA.Object)obj;
            isCorbaObject = true;
        }

        // Write the boolean flag.
        this.write_boolean(isCorbaObject);

        // Now write out the object.
        if (isCorbaObject) {
            write_Object(theCorbaObject);
        } else {
            try {
                write_value((java.io.Serializable)obj);
            } catch(ClassCastException cce) {
                if (obj instanceof java.io.Serializable) {
                    throw cce;
                } else {
                    ORBUtility.throwNotSerializableForCorba(
                                                    obj.getClass().getName());
                }
            }
        }
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:IDLJavaSerializationOutputStream.java

示例3: write_abstract_interface

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
public void write_abstract_interface(java.lang.Object obj) {
    boolean corbaObject = false; // Assume value type.
    org.omg.CORBA.Object theObject = null;

    // Is it a CORBA.Object?

    if (obj != null && obj instanceof org.omg.CORBA.Object) {

        // Yes.

        theObject = (org.omg.CORBA.Object)obj;
        corbaObject = true;
    }

    // Write our flag...

    write_boolean(corbaObject);

    // Now write out the object...

    if (corbaObject) {
        write_Object(theObject);
    } else {
        try {
            write_value((java.io.Serializable)obj);
        } catch(ClassCastException cce) {
            if (obj instanceof java.io.Serializable)
                throw cce;
            else
                ORBUtility.throwNotSerializableForCorba(obj.getClass().getName());
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:CDROutputStream_1_0.java


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