Package org.apache.yoko.orb.CORBA

Examples of org.apache.yoko.orb.CORBA.OutputStream


        if (!dyn_any.type().equivalent(type_))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();

        DynAny_impl impl = (DynAny_impl) dyn_any;
        org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
        OutputStream out = new OutputStream(buf);
        out._OB_ORBInstance(orbInstance_);
        impl._OB_marshal(out);
        org.omg.CORBA.portable.InputStream in = out.create_input_stream();
        _OB_unmarshal((InputStream) in);

        notifyParent();
    }
View Full Code Here


    public synchronized org.omg.CORBA.Any to_any(DynValueWriter dynValueWriter) {
        if (destroyed_)
            throw new org.omg.CORBA.OBJECT_NOT_EXIST();

        org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
        OutputStream out = new OutputStream(buf);
        out._OB_ORBInstance(orbInstance_);

        if (dynValueWriter != null)
            _OB_marshal(out, dynValueWriter);
        else
            _OB_marshal(out);

        org.omg.CORBA.portable.InputStream in = out.create_input_stream();
        Any result = new Any(orbInstance_, type_, in);
        return result;
    }
View Full Code Here

        DynValueWriter dynValueWriter = new DynValueWriter(orbInstance_,
                factory_);

        org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
        OutputStream out = new OutputStream(buf);
        out._OB_ORBInstance(orbInstance_);
        _OB_marshal(out, dynValueWriter);

        dynValueReader_ = dynValueWriter.getReader();

        org.omg.DynamicAny.DynAny result = prepare(type_, dynValueReader_,
                false);

        DynSeqBase_impl seq = (DynSeqBase_impl) result;

        org.omg.CORBA.portable.InputStream in = out.create_input_stream();
        seq._OB_unmarshal((InputStream) in);

        return result;
    }
View Full Code Here

                && origTC.kind() != org.omg.CORBA.TCKind.tk_value_box)
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();

        DynAny_impl impl = (DynAny_impl) comp;
        org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
        OutputStream out = new OutputStream(buf);
        out._OB_ORBInstance(orbInstance_);
        impl._OB_marshal(out);
        InputStream in = (InputStream) out.create_input_stream();
        // This is not necessary
        // in._OB_ORBInstance(orbInstance_);

        return in.read_value();
    }
View Full Code Here

    public synchronized org.omg.CORBA.Any to_any(DynValueWriter dynValueWriter) {
        if (destroyed_)
            throw new org.omg.CORBA.OBJECT_NOT_EXIST();

        org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
        OutputStream out = new OutputStream(buf);
        out._OB_ORBInstance(orbInstance_);

        if (dynValueWriter != null)
            _OB_marshal(out, dynValueWriter);
        else
            _OB_marshal(out);

        InputStream in = (InputStream) out.create_input_stream();
        Any result = new Any(orbInstance_, type_, in);
        return result;
    }
View Full Code Here

        //
        DynValueWriter dynValueWriter = new DynValueWriter(orbInstance_,
                factory_);

        org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
        OutputStream out = new OutputStream(buf);
        out._OB_ORBInstance(orbInstance_);
        _OB_marshal(out, dynValueWriter);

        dynValueReader_ = dynValueWriter.getReader();

        org.omg.DynamicAny.DynAny result = prepare(type_, dynValueReader_,
                false);
        DynAny_impl impl = (DynAny_impl) result;

        InputStream in = (InputStream) out.create_input_stream();
        impl._OB_unmarshal(in);

        return result;
    }
View Full Code Here

        if (is_null())
            return new Any(orbInstance_, type_, null);
        else {
            org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
            OutputStream out = new OutputStream(buf);
            out._OB_ORBInstance(orbInstance_);
            _OB_marshal(out);
            InputStream in = (InputStream) out.create_input_stream();
            return new Any(orbInstance_, type_, in);
        }
    }
View Full Code Here

    public synchronized org.omg.CORBA.Any to_any(DynValueWriter dynValueWriter) {
        if (destroyed_)
            throw new org.omg.CORBA.OBJECT_NOT_EXIST();

        org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
        OutputStream out = new OutputStream(buf);
        out._OB_ORBInstance(orbInstance_);

        if (dynValueWriter != null)
            _OB_marshal(out, dynValueWriter);
        else
            _OB_marshal(out);

        InputStream in = (InputStream) out.create_input_stream();
        Any result = new Any(orbInstance_, type_, in);
        return result;
    }
View Full Code Here

        if (is_null())
            return new Any(orbInstance_, type_, null);
        else {
            org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
            OutputStream out = new OutputStream(buf);
            out._OB_ORBInstance(orbInstance_);

            if (dynValueWriter != null)
                _OB_marshal(out, dynValueWriter);
            else
                _OB_marshal(out);

            InputStream in = (InputStream) out.create_input_stream();
            return new Any(orbInstance_, type_, in);
        }
    }
View Full Code Here

                        ior.value.profiles.length);
                ior.value.profiles = profiles;
                ior.value.profiles[len - 1] = new org.omg.IOP.TaggedProfile();
                ior.value.profiles[len - 1].tag = org.omg.IOP.TAG_INTERNET_IOP.value;
                org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
                OutputStream out = new OutputStream(buf);
                out._OB_writeEndian();
                org.omg.IIOP.ProfileBody_1_0Helper.write(out, body);
                ior.value.profiles[len - 1].profile_data = new byte[buf
                        .length()];
                System.arraycopy(buf.data(), 0,
                        ior.value.profiles[len - 1].profile_data, 0, buf
                                .length());
            }
        } else {
            if (multiProfile_) {
                //
                // Add one profile for each host
                //

                for (int i = 0; i < hosts_.length; i++) {
                    org.omg.IIOP.ProfileBody_1_1 body = new org.omg.IIOP.ProfileBody_1_1();
                    body.iiop_version = new org.omg.IIOP.Version(
                            profileInfo.major, profileInfo.minor);
                    body.host = hosts_[i];
                    if (port_ >= 0x8000)
                        body.port = (short) (port_ - 0xffff - 1);
                    else
                        body.port = (short) port_;
                    body.object_key = profileInfo.key;
                    body.components = new org.omg.IOP.TaggedComponent[components
                            .size()];
                    components.copyInto(body.components);

                    int len = ior.value.profiles.length + 1;
                    org.omg.IOP.TaggedProfile[] profiles = new org.omg.IOP.TaggedProfile[len];
                    System.arraycopy(ior.value.profiles, 0, profiles, 0,
                            ior.value.profiles.length);
                    ior.value.profiles = profiles;
                    ior.value.profiles[len - 1] = new org.omg.IOP.TaggedProfile();
                    ior.value.profiles[len - 1].tag = org.omg.IOP.TAG_INTERNET_IOP.value;
                    org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
                    OutputStream out = new OutputStream(buf);
                    out._OB_writeEndian();
                    org.omg.IIOP.ProfileBody_1_1Helper.write(out, body);
                    ior.value.profiles[len - 1].profile_data = new byte[buf
                            .length()];
                    System.arraycopy(buf.data(), 0,
                            ior.value.profiles[len - 1].profile_data, 0, buf
                                    .length());
                }
            } else {
                //
                // Add a single tagged profile. If there are additional
                // hosts, add a tagged component for each host.
                //

                org.omg.IIOP.ProfileBody_1_1 body = new org.omg.IIOP.ProfileBody_1_1();
                body.iiop_version = new org.omg.IIOP.Version(profileInfo.major,
                        profileInfo.minor);
                body.host = hosts_[0];
                if (port_ >= 0x8000)
                    body.port = (short) (port_ - 0xffff - 1);
                else
                    body.port = (short) port_;
                body.object_key = profileInfo.key;

                for (int i = 1; i < hosts_.length; i++) {
                    org.omg.IOP.TaggedComponent c = new org.omg.IOP.TaggedComponent();
                    c.tag = org.omg.IOP.TAG_ALTERNATE_IIOP_ADDRESS.value;
                    org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
                    OutputStream out = new OutputStream(buf);
                    out._OB_writeEndian();
                    out.write_string(hosts_[i]);
                    out.write_ushort(body.port);
                    c.component_data = new byte[buf.length()];
                    System.arraycopy(buf.data(), 0, c.component_data, 0, buf
                            .length());
                    components.addElement(c);
                }
                body.components = new org.omg.IOP.TaggedComponent[components
                        .size()];
                components.copyInto(body.components);

                int len = ior.value.profiles.length + 1;
                org.omg.IOP.TaggedProfile[] profiles = new org.omg.IOP.TaggedProfile[len];
                System.arraycopy(ior.value.profiles, 0, profiles, 0,
                        ior.value.profiles.length);
                ior.value.profiles = profiles;
                ior.value.profiles[len - 1] = new org.omg.IOP.TaggedProfile();
                ior.value.profiles[len - 1].tag = org.omg.IOP.TAG_INTERNET_IOP.value;
                org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
                OutputStream out = new OutputStream(buf);
                out._OB_writeEndian();
                org.omg.IIOP.ProfileBody_1_1Helper.write(out, body);
                ior.value.profiles[len - 1].profile_data = new byte[buf
                        .length()];
                System.arraycopy(buf.data(), 0,
                        ior.value.profiles[len - 1].profile_data, 0, buf
View Full Code Here

TOP

Related Classes of org.apache.yoko.orb.CORBA.OutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.