Package org.apache.yoko.orb.CORBA

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


                components_[index] = create(contentType_, true);
            else
                return;
        }

        Any any = new Any(orbInstance_);
        getValue(index, any);
        ignoreChild_ = true;

        try {
            components_[index].from_any(any);
View Full Code Here


    protected org.omg.CORBA.Any[] getElements() {
        org.omg.CORBA.Any[] result = new org.omg.CORBA.Any[length_];
        for (int i = 0; i < length_; i++) {
            if (primitive_) {
                result[i] = new Any(orbInstance_);
                getValue(i, result[i]);
            } else {
                result[i] = components_[i].to_any();
            }
        }
View Full Code Here

        //
        // Convert value to an ORBacus Any - the JDK implementation
        // of TypeCode.equivalent() raises NO_IMPLEMENT
        //
        Any val = null;
        try {
            val = (Any) value;
        } catch (ClassCastException ex) {
            try {
                val = new Any(value);
            } catch (NullPointerException e) {
                throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
            }
        }

        if (!val._OB_type().equivalent(type_))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();

        if (val.value() == null)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();

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

        index_ = 0;

        notifyParent();
View Full Code Here

            _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

        //
        // Convert value to an ORBacus Any - the JDK implementation
        // of TypeCode.equivalent() raises NO_IMPLEMENT
        //
        Any val = null;
        try {
            val = (Any) value;
        } catch (ClassCastException ex) {
            try {
                val = new Any(value);
            } catch (NullPointerException e) {
                throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
            }
        }

        if (!val._OB_type().equivalent(type_))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();

        try {
            java.math.BigDecimal f = val.extract_fixed();

            if (f == null || f.scale() > origType_.fixed_scale())
                throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
            value_ = f;
        } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) {
View Full Code Here

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

        return new Any(orbInstance_, type_, value_);
    }
View Full Code Here

            throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
            org.omg.DynamicAny.DynAnyPackage.InvalidValue {
        if (destroyed_)
            throw new org.omg.CORBA.OBJECT_NOT_EXIST();

        Any val = null;
        try {
            val = (Any) value;
        } catch (ClassCastException ex) {
            val = new Any(value);
        }

        if (val.value() == null)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();

        if (!val._OB_type().equivalent(type_))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();

        value_ = ((Integer) val.value()).intValue();

        notifyParent();
    }
View Full Code Here

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

        return new Any(orbInstance_, type_, new Integer(value_));
    }
View Full Code Here

        org.apache.yoko.orb.OB.Assert._OB_assert(length_ > 0);
    }

    protected void getValue(int index, org.omg.CORBA.Any a) {
        Any any = (Any) a;

        //
        // Get the value from the primitive array at the given index
        // and insert it into the any
        //

        org.apache.yoko.orb.OB.Assert._OB_assert(index < length_ && primitive_);

        switch (contentKind_.value()) {
        case org.omg.CORBA.TCKind._tk_short: {
            short[] buf = (short[]) buf_;
            any.replace(contentType_, new Integer(buf[index]));
            break;
        }

        case org.omg.CORBA.TCKind._tk_long: {
            int[] buf = (int[]) buf_;
            any.replace(contentType_, new Integer(buf[index]));
            break;
        }

        case org.omg.CORBA.TCKind._tk_ushort: {
            short[] buf = (short[]) buf_;
            any.replace(contentType_, new Integer(buf[index]));
            break;
        }

        case org.omg.CORBA.TCKind._tk_ulong: {
            int[] buf = (int[]) buf_;
            any.replace(contentType_, new Integer(buf[index]));
            break;
        }

        case org.omg.CORBA.TCKind._tk_float: {
            float[] buf = (float[]) buf_;
            any.replace(contentType_, new Float(buf[index]));
            break;
        }

        case org.omg.CORBA.TCKind._tk_double: {
            double[] buf = (double[]) buf_;
            any.replace(contentType_, new Double(buf[index]));
            break;
        }

        case org.omg.CORBA.TCKind._tk_boolean: {
            boolean[] buf = (boolean[]) buf_;
            any.replace(contentType_, Boolean.valueOf(buf[index]));
            break;
        }

        case org.omg.CORBA.TCKind._tk_char: {
            char[] buf = (char[]) buf_;
            any.replace(contentType_, new Character(buf[index]));
            break;
        }

        case org.omg.CORBA.TCKind._tk_octet: {
            byte[] buf = (byte[]) buf_;
            any.replace(contentType_, new Byte(buf[index]));
            break;
        }

        case org.omg.CORBA.TCKind._tk_string: {
            String[] buf = (String[]) buf_;
            any.replace(contentType_, new String(buf[index]));
            break;
        }

        case org.omg.CORBA.TCKind._tk_longlong: {
            long[] buf = (long[]) buf_;
            any.replace(contentType_, new Long(buf[index]));
            break;
        }

        case org.omg.CORBA.TCKind._tk_ulonglong: {
            long[] buf = (long[]) buf_;
            any.replace(contentType_, new Long(buf[index]));
            break;
        }

        case org.omg.CORBA.TCKind._tk_wchar: {
            char[] buf = (char[]) buf_;
            any.replace(contentType_, new Character(buf[index]));
            break;
        }

        case org.omg.CORBA.TCKind._tk_wstring: {
            String[] buf = (String[]) buf_;
            any.replace(contentType_, new String(buf[index]));
            break;
        }

        default:
            org.apache.yoko.orb.OB.Assert._OB_assert(false);
View Full Code Here

                components_[index] = create(contentType_, true);
            else
                return;
        }

        Any any = new Any(orbInstance_);
        getValue(index, any);
        ignoreChild_ = true;

        try {
            components_[index].from_any(any);
View Full Code Here

TOP

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

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.