Package org.apache.geronimo.corba.io

Examples of org.apache.geronimo.corba.io.EncapsulationInputStream


  private void parseIOR(String url) {
    String hexString = url.substring(schemeEnd + 1);
    byte[] data = HexUtil.hexToByteArray(hexString);
   
    InputStreamBase in = new EncapsulationInputStream(orb, data);
    IOR ior = org.omg.IOP.IORHelper.read(in);
    this.ior = new InternalIOR(orb, ior);
  }
View Full Code Here


                map.put(new Integer(pos), tc);
                return tc;
            }
        }

        EncapsulationInputStream encap_in;

        switch (kind) {
            case TCKind._tk_null:
            case TCKind._tk_void:
            case TCKind._tk_short:
            case TCKind._tk_long:
            case TCKind._tk_longlong:
            case TCKind._tk_ushort:
            case TCKind._tk_ulong:
            case TCKind._tk_ulonglong:
            case TCKind._tk_float:
            case TCKind._tk_double:
            case TCKind._tk_longdouble:
            case TCKind._tk_boolean:
            case TCKind._tk_char:
            case TCKind._tk_wchar:
            case TCKind._tk_octet:
            case TCKind._tk_any:
            case TCKind._tk_TypeCode:
            case TCKind._tk_Principal:
                tc = get_primitive_tc(TCKind.from_int(kind));
                break;

            case TCKind._tk_fixed:
                tc = create_fixed_tc(in.read_ushort(), in.read_short());
                break;

            case TCKind._tk_objref:
                encap_in = in.__open_encapsulation();
                try {
                    tc = create_interface_tc(encap_in.read_string(), encap_in
                            .read_string());
                }
                finally {
                    in.__close_encapsulation(encap_in);
                }
                break;

            case TCKind._tk_abstract_interface:
                encap_in = in.__open_encapsulation();
                try {
                    tc = create_abstract_interface_tc(encap_in.read_string(),
                                                      encap_in.read_string());
                }
                finally {
                    in.__close_encapsulation(encap_in);
                }
                in.__close_encapsulation(encap_in);
                break;

            case TCKind._tk_native:
                encap_in = in.__open_encapsulation();
                try {
                    tc = create_native_tc(encap_in.read_string(), encap_in
                            .read_string());
                }
                finally {
                    in.__close_encapsulation(encap_in);
                }
                break;

            case TCKind._tk_struct:
            case TCKind._tk_except: {
                encap_in = in.__open_encapsulation();
                try {

                    tc = new TypeCodeImpl();
                    map.put(new Integer(pos), tc);
                    tc.kind = TCKind.from_int(kind);
                    tc.id = encap_in.read_string();
                    tc.name = encap_in.read_string();
                    int count = encap_in.read_ulong();
                    tc.memberNames = new String[count];
                    tc.memberTypes = new TypeCodeImpl[count];
                    for (int i = 0; i < count; i++) {
                        tc.memberNames[i] = encap_in.read_string();
                        tc.memberTypes[i] = read(encap_in, toplevel, map);
                    }

                }
                finally {
                    in.__close_encapsulation(encap_in);
                }

                break;
            }

            case TCKind._tk_union: {
                encap_in = in.__open_encapsulation();
                try {

                    tc = new TypeCodeImpl();
                    map.put(new Integer(pos), tc);
                    tc.kind = TCKind.tk_union;
                    tc.id = encap_in.read_string();
                    tc.name = encap_in.read_string();
                    tc.discriminatorType = read(encap_in, toplevel, map);
                    int index = encap_in.read_long();
                    int count = encap_in.read_ulong();
                    tc.labels = new AnyImpl[count];
                    tc.memberNames = new String[count];
                    tc.memberTypes = new TypeCodeImpl[count];

                    for (int i = 0; i < count; i++) {
                        tc.labels[i] = new AnyImpl(encap_in.__orb());
                        if (i == index) {
                            AnyImpl scrap = new AnyImpl(encap_in.__orb());
                            scrap.read_value(encap_in, tc.discriminatorType);
                            tc.labels[i].insert_octet((byte) 0);
                        } else {
                            tc.labels[i].read_value(encap_in, tc.discriminatorType);
                        }

                        tc.memberNames[i] = encap_in.read_string();
                        tc.memberTypes[i] = read(encap_in, toplevel, map);
                    }

                }
                finally {
                    in.__close_encapsulation(encap_in);
                }

                break;
            }

            case TCKind._tk_enum: {
                encap_in = in.__open_encapsulation();
                try {
                    String id = encap_in.read_string();
                    String name = encap_in.read_string();
                    int count = encap_in.read_ulong();
                    String[] names = new String[count];
                    for (int i = 0; i < count; i++)
                        names[i] = encap_in.read_string();
                    tc = create_enum_tc(id, name, names);

                }
                finally {
                    in.__close_encapsulation(encap_in);
                }

                break;
            }

            case TCKind._tk_string:
                tc = create_string_tc(in.read_ulong());
                break;

            case TCKind._tk_wstring:
                tc = create_wstring_tc(in.read_ulong());
                break;

            case TCKind._tk_sequence:
            case TCKind._tk_array:

                encap_in = in.__open_encapsulation();
                try {
                    tc = new TypeCodeImpl();
                    map.put(new Integer(pos), tc);

                    tc.kind = TCKind.from_int(kind);
                    tc.contentType = read(encap_in, toplevel, map);
                    tc.length = encap_in.read_ulong();
                }
                finally {
                    in.__close_encapsulation(encap_in);
                }

                break;

            case TCKind._tk_alias:
                encap_in = in.__open_encapsulation();
                try {
                    tc = create_alias_tc(encap_in.read_string(), encap_in
                            .read_string(), read(encap_in, toplevel, map));
                }
                finally {
                    in.__close_encapsulation(encap_in);
                }
                // in.__swap (swap);
                break;

            case TCKind._tk_value:
                encap_in = in.__open_encapsulation();
                try {

                    tc = new TypeCodeImpl();
                    map.put(new Integer(pos), tc);
                    tc.kind = TCKind.tk_value;
                    tc.id = encap_in.read_string();
                    tc.name = encap_in.read_string();
                    tc.typeModifier = encap_in.read_short();
                    tc.concreteBaseType = read(encap_in, toplevel, map);
                    if (tc.concreteBaseType.kind() == TCKind.tk_null) {
                        tc.concreteBaseType = null;
                    }
                    int count = encap_in.read_ulong();
                    tc.memberNames = new String[count];
                    tc.memberTypes = new TypeCodeImpl[count];
                    tc.memberVisibility = new short[count];

                    for (int i = 0; i < count; i++) {
                        tc.memberNames[i] = encap_in.read_string();
                        tc.memberTypes[i] = read(encap_in, toplevel, map);
                        tc.memberVisibility[i] = encap_in.read_short();
                    }

                }
                finally {
                    in.__close_encapsulation(encap_in);
                }

                break;

            case TCKind._tk_value_box:
                encap_in = in.__open_encapsulation();
                try {

                    tc = create_value_box_tc(encap_in.read_string(), encap_in
                            .read_string(), read(encap_in, toplevel, map));
                }
                finally {
                    in.__close_encapsulation(encap_in);
                }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.corba.io.EncapsulationInputStream

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.