Package org.apache.yoko.bindings.corba

Examples of org.apache.yoko.bindings.corba.CorbaStreamable


            outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES,
                                      Boolean.TRUE);       

            ByteArrayOutputStream outStream = new ByteArrayOutputStream();
            XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
            CorbaStreamable retVal = outMessage.getStreamableReturn();
            corbaStaxObject.writeObjectToStax(retVal.getObject(), evtWriter,
                                              XMLEventFactory.newInstance());
            evtWriter.flush();
            ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
            XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);           
            MessagePartInfo part = getReturnMessagePartInfo(msgInfo);
View Full Code Here


            ModeType paramMode = param.getMode();
            CorbaObjectHandler obj =
                CorbaHandlerUtils.initializeObjectHandler(orb, paramName, paramIdlType, maps, service);

            streamables[i] = new CorbaStreamable(obj, paramName);
            if (paramMode.value().equals("in")) {
                streamables[i].setMode(org.omg.CORBA.ARG_IN.value);
            } else if (paramMode.value().equals("out")) {
                streamables[i].setMode(org.omg.CORBA.ARG_OUT.value);
            } else {
View Full Code Here

        writer.write(fault, faultPart, evtWriter);
        LOG.log(Level.INFO, "Found exception in the raises list.  Marshalling.");
        ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
        XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
        CorbaObjectHandler obj = corbaStaxObject.readObjectFromStax(evtReader, exIdlType);
        CorbaStreamable streamable = new CorbaStreamable(obj, elName);
        message.setStreamableException(streamable);
    }
View Full Code Here

        if (returnParam != null) {
            QName retIdlType = returnParam.getIdltype();
            QName retName = new QName("", returnParam.getName());
            CorbaObjectHandler obj = CorbaHandlerUtils
                .initializeObjectHandler(orb, retName, retIdlType, typeMaps, service);
            CorbaStreamable streamable = new CorbaStreamable(obj, retName);
            message.setStreamableReturn(streamable);
        }
    }
View Full Code Here

                if (param.getMode().equals(ModeType.OUT)) {
                    obj = CorbaHandlerUtils.initializeObjectHandler(orb, elName, idlType, typeMaps, service);
                } else {
                    obj = corbaStaxObject.readObjectFromStax(evtReader, idlType);
                }
                CorbaStreamable streamable = new CorbaStreamable(obj, elName);
                ModeType paramMode = param.getMode();
                if (paramMode.value().equals("in")) {
                    streamable.setMode(org.omg.CORBA.ARG_IN.value);
                } else if (paramMode.value().equals("inout")) {
                    streamable.setMode(org.omg.CORBA.ARG_INOUT.value);
                } else if (paramMode.value().equals("out")) {
                    streamable.setMode(org.omg.CORBA.ARG_OUT.value);
                }
                message.addStreamableArgument(streamable);
            }
        }
    }
View Full Code Here

            ArgType returnParam = opType.getReturn();
            if (returnParam != null) {
                QName retIdlType = returnParam.getIdltype();
                QName retName = new QName("", returnParam.getName());
                CorbaObjectHandler obj = corbaStaxObject.readObjectFromStax(evtReader, retIdlType);
                CorbaStreamable streamable = new CorbaStreamable(obj, retName);
                message.setStreamableReturn(streamable);
            }

            for (Iterator<ParamType> iter = params.iterator(); iter.hasNext();) {
                ParamType param = iter.next();
                QName idlType = param.getIdltype();
                QName elName = new QName("", param.getName());
                CorbaObjectHandler obj = null;

                if (param.getMode().equals(ModeType.IN)) {
                    obj = CorbaHandlerUtils.initializeObjectHandler(orb, elName, idlType, typeMaps, service);
                } else {
                    obj = corbaStaxObject.readObjectFromStax(evtReader, idlType);
                }

                CorbaStreamable streamable = new CorbaStreamable(obj, elName);
                ModeType paramMode = param.getMode();
                if (paramMode.value().equals("in")) {
                    streamable.setMode(org.omg.CORBA.ARG_IN.value);
                } else if (paramMode.value().equals("inout")) {
                    streamable.setMode(org.omg.CORBA.ARG_INOUT.value);
                } else if (paramMode.value().equals("out")) {
                    streamable.setMode(org.omg.CORBA.ARG_OUT.value);
                }
                message.addStreamableArgument(streamable);
            }
        }
    }           
View Full Code Here

    }   

    public void handleMessage(Message msg) {
        CorbaMessage message = (CorbaMessage)msg;
        try {
            CorbaStreamable exStreamable = message.getStreamableException();
            if (exStreamable != null) {
                EventDataReader reader = (EventDataReader) ContextUtils.getDataReader(message);

                BindingOperationInfo bopInfo = message.getExchange().get(BindingOperationInfo.class);
                OperationType opType = bopInfo.getExtensor(OperationType.class);
                OperationInfo opInfo = bopInfo.getOperationInfo();
               
                List<CorbaTypeMap> typeMaps = new ArrayList<CorbaTypeMap>();

                ServiceInfo service = message.getExchange().get(ServiceInfo.class);
                List<TypeMappingType> corbaTypes =
                    service.getDescription().getExtensors(TypeMappingType.class);
                if (corbaTypes != null) {
                    corbaStaxObject.setTypeMaps(typeMaps);
                    corbaStaxObject.setServiceInfo(service);
                }

                org.omg.CORBA.ORB orb = (org.omg.CORBA.ORB) message.get(CorbaConstants.ORB);
                if (orb == null) {
                    orb = (org.omg.CORBA.ORB) message.getExchange().get(org.omg.CORBA.ORB.class);
                }
                corbaStaxObject.setOrb(orb);
                QName elName = new QName("", exStreamable.getName());

                XMLInputFactory inputFactory = getXMLInputFactory();
                XMLOutputFactory outputFactory = getXMLOutputFactory();
               
                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
                XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
                corbaStaxObject.writeObjectToStax(exStreamable.getObject(),
                                                  evtWriter,
                                                  XMLEventFactory.newInstance());
                evtWriter.flush();
                ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
                XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
View Full Code Here

TOP

Related Classes of org.apache.yoko.bindings.corba.CorbaStreamable

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.