Java Code Examples for com.sun.corba.se.impl.orbutil.ORBUtility#throwNotSerializableForCorba()

The following examples show how to use com.sun.corba.se.impl.orbutil.ORBUtility#throwNotSerializableForCorba() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IDLJavaSerializationOutputStream.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
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());
                }
            }
        }
    }
 
Example 2
Source File: IDLJavaSerializationOutputStream.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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());
                }
            }
        }
    }
 
Example 3
Source File: Util.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example 4
Source File: IDLJavaSerializationOutputStream.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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());
                }
            }
        }
    }
 
Example 5
Source File: CDROutputStream_1_0.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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());
        }
    }
}
 
Example 6
Source File: Util.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example 7
Source File: Util.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example 8
Source File: IDLJavaSerializationOutputStream.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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());
                }
            }
        }
    }
 
Example 9
Source File: CDROutputStream_1_0.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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());
        }
    }
}
 
Example 10
Source File: CDROutputStream_1_0.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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());
        }
    }
}
 
Example 11
Source File: Util.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example 12
Source File: Util.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * 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);
}
 
Example 13
Source File: CDROutputStream_1_0.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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());
        }
    }
}
 
Example 14
Source File: IDLJavaSerializationOutputStream.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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());
                }
            }
        }
    }
 
Example 15
Source File: IDLJavaSerializationOutputStream.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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());
                }
            }
        }
    }
 
Example 16
Source File: CDROutputStream_1_0.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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());
        }
    }
}
 
Example 17
Source File: IDLJavaSerializationOutputStream.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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());
                }
            }
        }
    }
 
Example 18
Source File: Util.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example 19
Source File: CDROutputStream_1_0.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
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());
        }
    }
}
 
Example 20
Source File: CDROutputStream_1_0.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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());
        }
    }
}