Package org.apache.schemas.yoko.bindings.corba

Examples of org.apache.schemas.yoko.bindings.corba.Exception


                                                  CorbaObjectHandler obj,
                                                  QName name,
                                                  XmlSchemaObject schemaType,
                                                  List<CorbaTypeMap> typeMaps,
                                                  ServiceInfo serviceInfo) {
        Exception exceptType = (Exception)obj.getType();
        List<MemberType> exceptMembers = exceptType.getMember();
        XmlSchemaComplexType ctype = (XmlSchemaComplexType) schemaType;
        QName qname = name;
        if (ctype.getQName() != null) {
            qname = ctype.getQName();
        }
View Full Code Here


       
        QName exceptIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "exception", CorbaConstants.NP_WSDL_CORBA);
        QName shortIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "short", CorbaConstants.NP_WSDL_CORBA);
        QName stringIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "string", CorbaConstants.NP_WSDL_CORBA);
       
        Exception exceptType = new Exception();
        exceptType.setName("TestException");
        exceptType.setRepositoryID(reposID);
        MemberType m1 = new MemberType();
        m1.setIdltype(shortIdlType);
        m1.setName("code");
        MemberType m2 = new MemberType();
        m2.setIdltype(stringIdlType);
        m2.setName("message");
        exceptType.getMember().add(m1);
        exceptType.getMember().add(m2);

        // build the object holder
        StructMember[] exceptMembers = new StructMember[2];
        exceptMembers[0] = new StructMember("code", orb.get_primitive_tc(TCKind.tk_short), null);
        exceptMembers[1] = new StructMember("message", orb.get_primitive_tc(TCKind.tk_string), null);
View Full Code Here

        if (schemaType == null) {
            throw new CorbaBindingException("Couldn't find xml schema object for : " + idlType);
        }
        CorbaExceptionHandler obj = null;
        try {
            Exception exType = (Exception) CorbaUtils.getCorbaType(idlType, typeMaps);
            StartElement exStartEl = reader.nextEvent().asStartElement();
            obj = new CorbaExceptionHandler(exStartEl.getName(), idlType, tc, exType);
            XmlSchemaComplexType ctype = (XmlSchemaComplexType) schemaType;
            XmlSchemaGroupBase group = (XmlSchemaGroupBase) ctype.getParticle();
            List<MemberType> exMembers = exType.getMember();
            for (int i = 0; i < exMembers.size(); ++i) {
                CorbaObjectHandler member = readObjectFromStax(reader,
                                                               exMembers.get(i).getIdltype(),
                                                               group.getItems().getItem(i),
                                                               true);
View Full Code Here

        complexType.setParticle(sequence);

        element.setSchemaTypeName(complexType.getQName());
       
        // corba:exception
        Exception exception = new Exception();
        exception.setQName(new QName(typeMap.getTargetNamespace(), exceptionName));
        exception.setType(complexType.getQName());
        exception.setRepositoryID(scopedName.toIDLRepositoryID());

       
        // exception members
        AST memberTypeNode = identifierNode.getNextSibling();
        while (memberTypeNode != null) {
            AST memberNode = memberTypeNode.getNextSibling();

            TypesVisitor visitor = new TypesVisitor(exceptionScope,
                                                    schemas,
                                                    schema,
                                                    typeMap,
                                                    null);
            visitor.visit(memberTypeNode);
            XmlSchemaType stype = visitor.getSchemaType();
            CorbaTypeImpl ctype = visitor.getCorbaType();
           
            // needed for anonymous arrays in exceptions
            if (ArrayVisitor.accept(memberNode)) {
                Scope anonScope = new Scope(exceptionScope,
                                            TypesUtils.getCorbaTypeNameNode(memberTypeNode));
                ArrayVisitor arrayVisitor = new ArrayVisitor(anonScope,
                                                             schemas,
                                                             schema,
                                                             typeMap,
                                                             stype,
                                                             ctype,
                                                             null);
                arrayVisitor.visit(memberNode);
                stype = arrayVisitor.getSchemaType();
                ctype = arrayVisitor.getCorbaType();
            }

            // xmlschema:member
            XmlSchemaElement member = new XmlSchemaElement();
            String memberName = memberNode.toString();
            member.setName(memberName);
            member.setSchemaType(stype);
            member.setSchemaTypeName(stype.getQName());

            sequence.getItems().add(member);

           
            // corba:member
            MemberType memberType = new MemberType();
            memberType.setName(memberName);
            memberType.setIdltype(ctype.getQName());
            exception.getMember().add(memberType);
           
           
            memberTypeNode = memberNode.getNextSibling();
        }
View Full Code Here

       
        QName exceptIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "exception", CorbaConstants.NP_WSDL_CORBA);
        QName shortIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "short", CorbaConstants.NP_WSDL_CORBA);
        QName stringIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "string", CorbaConstants.NP_WSDL_CORBA);
       
        Exception exceptType = new Exception();
        exceptType.setName("TestException");
        MemberType m1 = new MemberType();
        m1.setIdltype(shortIdlType);
        m1.setName("code");
        MemberType m2 = new MemberType();
        m2.setIdltype(stringIdlType);
        m2.setName("message");
        exceptType.getMember().add(m1);
        exceptType.getMember().add(m2);

        // build the object holder
        StructMember[] exceptMembers = new StructMember[2];
        exceptMembers[0] = new StructMember("code", orb.get_primitive_tc(TCKind.tk_short), null);
        exceptMembers[1] = new StructMember("message", orb.get_primitive_tc(TCKind.tk_string), null);
View Full Code Here

        }
    }

    public void writeException(CorbaObjectHandler obj) throws CorbaBindingException {
        CorbaExceptionHandler exHandler = (CorbaExceptionHandler)obj;
        Exception exType = (Exception)exHandler.getType();
        List<CorbaObjectHandler> exMembers = exHandler.getMembers();
   
        stream.write_string(exType.getRepositoryID());
        for (int i = 0; i < exMembers.size(); ++i) {
            this.write(exMembers.get(i));
        }
    }
View Full Code Here

            for (int i = 0; i < members.length; ++i) {
                members[i] = ((Enumerator) enums.get(i)).getValue();
            }
            tc = orb.create_enum_tc(enumType.getRepositoryID(), name, members);
        } else if (obj instanceof Exception) {
            Exception exceptType = (Exception)obj;

            // TODO: check to see if this is a recursive type.
            List list = exceptType.getMember();
            StructMember[] members = new StructMember[list.size()];
            for (int i = 0; i < members.length; ++i) {
                MemberType member = (MemberType) list.get(i);
                members[i] = new StructMember(member.getName(),
                                              getTypeCode(orb, member.getIdltype(), typeMaps), null);
            }
            String name = exceptType.getName();
            tc = orb.create_exception_tc(exceptType.getRepositoryID(), name, members);
        } else if (obj instanceof Fixed) {
            Fixed fixedType = (Fixed) obj;
            tc = orb.create_fixed_tc((short) fixedType.getDigits(), (short) fixedType.getScale());
        } else if (obj instanceof org.apache.schemas.yoko.bindings.corba.Object) {
            org.apache.schemas.yoko.bindings.corba.Object objType =
View Full Code Here

        complexType.setParticle(sequence);

        element.setSchemaTypeName(complexType.getQName());
       
        // corba:exception
        Exception exception = new Exception();
        exception.setQName(new QName(typeMap.getTargetNamespace(), exceptionName));
        exception.setType(complexType.getQName());
        exception.setRepositoryID(CorbaConstants.REPO_STRING
                               + exceptionName
                               + CorbaConstants.IDL_VERSION);

       
        // exception members
        AST memberTypeNode = structNode.getNextSibling();
        while (memberTypeNode != null) {
            AST memberNode = memberTypeNode.getNextSibling();

            // xmlschema:member
            XmlSchemaElement member = new XmlSchemaElement();
            String memberName = memberNode.toString();
            member.setName(memberName);
            // type
            XmlSchemaType type = TypesUtils.findType(schemas, schema, memberTypeNode);
            member.setSchemaType(type);
            member.setSchemaTypeName(type.getQName());

            sequence.getItems().add(member);

           
            // corba:member
            MemberType memberType = new MemberType();
            memberType.setName(memberName);
            QName idlType = TypesUtils.findCorbaType(typeMap, type.getQName()).getQName();
            memberType.setIdltype(idlType);
            exception.getMember().add(memberType);
           
           
            memberTypeNode = memberNode.getNextSibling();
        }
View Full Code Here

       
        QName exceptIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "exception", CorbaConstants.NP_WSDL_CORBA);
        QName shortIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "short", CorbaConstants.NP_WSDL_CORBA);
        QName stringIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "string", CorbaConstants.NP_WSDL_CORBA);
       
        Exception exceptType = new Exception();
        exceptType.setName("TestException");
        exceptType.setRepositoryID(reposID);
        MemberType m1 = new MemberType();
        m1.setIdltype(shortIdlType);
        m1.setName("code");
        MemberType m2 = new MemberType();
        m2.setIdltype(stringIdlType);
        m2.setName("message");
        exceptType.getMember().add(m1);
        exceptType.getMember().add(m2);

        // build the object holder
        StructMember[] exceptMembers = new StructMember[2];
        exceptMembers[0] = new StructMember("code", orb.get_primitive_tc(TCKind.tk_short), null);
        exceptMembers[1] = new StructMember("message", orb.get_primitive_tc(TCKind.tk_string), null);
View Full Code Here

        }
    }
   
    public static void initializeExceptionHandler(ORB orb, CorbaObjectHandler obj,
                                                  QName name, List<CorbaTypeMap> typeMaps) {
        Exception exceptType = (Exception)obj.getType();
        List<MemberType> exceptMembers = exceptType.getMember();

        for (int i = 0; i < exceptMembers.size(); ++i) {
            MemberType member = exceptMembers.get(i);
            QName memberName = new QName(name.getNamespaceURI(), member.getName());
            QName memberType = member.getIdltype();
View Full Code Here

TOP

Related Classes of org.apache.schemas.yoko.bindings.corba.Exception

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.