Package org.apache.cxf.jaxb.io

Examples of org.apache.cxf.jaxb.io.EventDataReader


    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);
                FaultInfo fault = getFaultInfo(opInfo, elName);
                Object e = reader.read(fault.getMessageParts().get(0), evtReader);
                if (!(e instanceof Exception)) {
                    Class exClass = fault.getProperty(Class.class.getName(), Class.class);
                    Class beanClass = e.getClass();
                    Constructor constructor =
                        exClass.getConstructor(new Class[]{String.class, beanClass});
View Full Code Here


        throws Exception {
        QName opQName = null;
        OperationType opType = null;
        BindingInfo bInfo = destination.getBindingInfo();             
        InterfaceInfo info = bInfo.getInterface();       
        EventDataReader reader = (EventDataReader) ContextUtils.getDataReader(message);
        
        Exchange exchange = message.getExchange();
        orb = (ORB)exchange.get(ORB.class);
        if (corbaStaxObject != null) {
            corbaStaxObject.setOrb(orb);
View Full Code Here

                ep.getInFaultObserver().onMessage(message);
                return;
            }
        }

        EventDataReader reader;
        reader = (EventDataReader) ContextUtils.getDataReader(message);
        BindingInfo bInfo = destination.getBindingInfo();             
        InterfaceInfo info = bInfo.getInterface();
       
        Exchange exchange = message.getExchange();
View Full Code Here

    public <T> DataReader<T> createReader(Class<T> c) {
        DataReader<T> dr = null;
        if (c == XMLStreamReader.class) {
            dr = (DataReader<T>)new XMLStreamDataReader(context);
        } else if (c == XMLEventReader.class) {
            dr = (DataReader<T>)new EventDataReader(context);
        } else if (c == Node.class) {
            dr = (DataReader<T>)new NodeDataReader(context);
        }
       
        // TODO Auto-generated method stub
View Full Code Here

    public <T> DataReader<T> createReader(Class<T> cls) {
        DataReader<T> dr = null;
        if (cls == XMLStreamReader.class) {
            dr = (DataReader<T>)new XMLStreamDataReader(this);
        } else if (cls == XMLEventReader.class) {
            dr = (DataReader<T>)new EventDataReader(this);
        } else if (cls == Message.class) {
            dr = (DataReader<T>)new MessageDataReader(this);           
        } else if (cls == Node.class) {
            dr = (DataReader<T>)new NodeDataReader(this);
        } else if (cls == SOAPBody.class) {
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxb.io.EventDataReader

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.