Package org.apache.yoko.orb.CORBA

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


    }

    public synchronized long[] get_longlong_seq()
            throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
            org.omg.DynamicAny.DynAnyPackage.InvalidValue {
        Any any = _OB_currentAny();

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

        try {
View Full Code Here


    }

    public synchronized long[] get_ulonglong_seq()
            throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
            org.omg.DynamicAny.DynAnyPackage.InvalidValue {
        Any any = _OB_currentAny();

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

        try {
View Full Code Here

    }

    public synchronized float[] get_float_seq()
            throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
            org.omg.DynamicAny.DynAnyPackage.InvalidValue {
        Any any = _OB_currentAny();

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

        try {
View Full Code Here

    }

    public synchronized double[] get_double_seq()
            throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
            org.omg.DynamicAny.DynAnyPackage.InvalidValue {
        Any any = _OB_currentAny();

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

        try {
View Full Code Here

        org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(type);
        switch (origTC.kind().value()) {
        case org.omg.CORBA.TCKind._tk_null:
        case org.omg.CORBA.TCKind._tk_void:
            any_ = new Any(orbInstance_, type, null);
            break;

        case org.omg.CORBA.TCKind._tk_short:
        case org.omg.CORBA.TCKind._tk_ushort:
        case org.omg.CORBA.TCKind._tk_long:
        case org.omg.CORBA.TCKind._tk_ulong:
            any_ = new Any(orbInstance_, type, new Integer(0));
            break;

        case org.omg.CORBA.TCKind._tk_longlong:
        case org.omg.CORBA.TCKind._tk_ulonglong:
            any_ = new Any(orbInstance_, type, new Long(0));
            break;

        case org.omg.CORBA.TCKind._tk_float:
            any_ = new Any(orbInstance_, type, new Float(0));
            break;

        case org.omg.CORBA.TCKind._tk_double:
            any_ = new Any(orbInstance_, type, new Double(0));
            break;

        case org.omg.CORBA.TCKind._tk_boolean:
            any_ = new Any(orbInstance_, type, Boolean.FALSE);
            break;

        case org.omg.CORBA.TCKind._tk_char:
        case org.omg.CORBA.TCKind._tk_wchar:
            any_ = new Any(orbInstance_, type, new Character((char) 0));
            break;

        case org.omg.CORBA.TCKind._tk_octet:
            any_ = new Any(orbInstance_, type, new Byte((byte) 0));
            break;

        case org.omg.CORBA.TCKind._tk_any:
            any_ = new Any(orbInstance_, type, new Any(orbInstance_));
            break;

        case org.omg.CORBA.TCKind._tk_TypeCode: {
            org.omg.CORBA.TypeCode nullTC = org.apache.yoko.orb.OB.TypeCodeFactory
                    .createPrimitiveTC(org.omg.CORBA.TCKind.tk_null);
            any_ = new Any(orbInstance_, type, nullTC);
            break;
        }

        case org.omg.CORBA.TCKind._tk_objref:
        case org.omg.CORBA_2_4.TCKind._tk_local_interface:
            any_ = new Any(orbInstance_, type, null);
            break;

        case org.omg.CORBA.TCKind._tk_string:
        case org.omg.CORBA.TCKind._tk_wstring:
            any_ = new Any(orbInstance_, type, new String(""));
            break;

        case org.omg.CORBA.TCKind._tk_abstract_interface:
            any_ = new Any(orbInstance_, type, null);
            break;

        case org.omg.CORBA.TCKind._tk_value:
            //
            // Only custom valuetypes are supported by DynBasic_impl
            //
            try {
                org.apache.yoko.orb.OB.Assert
                        ._OB_assert(origTC.type_modifier() == org.omg.CORBA.VM_CUSTOM.value);
            } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) {
                org.apache.yoko.orb.OB.Assert._OB_assert(false);
            }
            any_ = new Any(orbInstance_, type, null);
            break;

        case org.omg.CORBA.TCKind._tk_Principal:
        default:
            org.apache.yoko.orb.OB.Assert._OB_assert(false);
View Full Code Here

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

        org.omg.CORBA.TypeCode tc = any_._OB_type();
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(any_);
    }
View Full Code Here

    public synchronized org.omg.DynamicAny.DynAny copy() {
        if (destroyed_)
            throw new org.omg.CORBA.OBJECT_NOT_EXIST();

        DynBasic_impl result = new DynBasic_impl(factory_, orbInstance_, type_);
        result.any_ = new Any(any_);
        return result;
    }
View Full Code Here

        try {
            checkValue(any_, org.omg.CORBA.TCKind.tk_any);

            DynAny_impl impl = (DynAny_impl) p;
            Any implAny = impl._OB_currentAny();
            checkValue(implAny, org.omg.CORBA.TCKind.tk_any);
            Any any = (Any) implAny.value();

            any_.replace(any_.type(), new Any(any));

            if (comp_ != null)
                comp_ = null;

            return true;
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

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.