Package org.objectweb.celtix.context

Examples of org.objectweb.celtix.context.ObjectMessageContext


    }

    private ObjectMessageContext setUpContext(String sid,
                                        BigInteger messageNumber,
                                        boolean storeSequence) {
        ObjectMessageContext context =
            control.createMock(ObjectMessageContext.class);
        if (storeSequence) {
            setUpSequenceType(context, sid, messageNumber);
        }
        contexts.add(context);
View Full Code Here


        RMSoapHandler codec = new RMSoapHandler();
        TestInputStreamContext istreamCtx = new TestInputStreamContext();
        istreamCtx.setInputStream(RMEndpointTest.class
            .getResourceAsStream("resources/spec/Message1.xml"));
        sb = new SOAPBindingImpl(false);
        ObjectMessageContext objectCtx = new ObjectMessageContextImpl();
        SOAPMessageContext context = (SOAPMessageContext)sb.createBindingMessageContext(objectCtx);
        sb.read(istreamCtx, context);
        assertTrue(codec.handleMessage(context));
        RMProperties rmps = RMContextUtils.retrieveRMProperties(context, false);
        SequenceType st = rmps.getSequence();
View Full Code Here

        RMSoapHandler codec = new RMSoapHandler();
        TestInputStreamContext istreamCtx = new TestInputStreamContext();
        istreamCtx.setInputStream(RMEndpointTest.class
            .getResourceAsStream("resources/spec/Acknowledgment.xml"));
        sb = new SOAPBindingImpl(false);
        ObjectMessageContext objectCtx = new ObjectMessageContextImpl();
        SOAPMessageContext context = (SOAPMessageContext)sb.createBindingMessageContext(objectCtx);
        sb.read(istreamCtx, context);
       
        assertTrue(codec.handleMessage(context));
        RMProperties rmps = RMContextUtils.retrieveRMProperties(context, false);
View Full Code Here

        RMSoapHandler codec = new RMSoapHandler();
        TestInputStreamContext istreamCtx = new TestInputStreamContext();
        istreamCtx.setInputStream(RMEndpointTest.class
            .getResourceAsStream("resources/spec/Retransmission.xml"));
        sb = new SOAPBindingImpl(false);
        ObjectMessageContext objectCtx = new ObjectMessageContextImpl();
        SOAPMessageContext context = (SOAPMessageContext)sb.createBindingMessageContext(objectCtx);
        sb.read(istreamCtx, context);
       
        assertTrue(codec.handleMessage(context));
        RMProperties rmps = RMContextUtils.retrieveRMProperties(context, false);
View Full Code Here

        sb = new SOAPBindingImpl(false);
    }

    private SOAPMessageContext setupOutboundContext() throws Exception {
        ObjectMessageContext objectCtx = new ObjectMessageContextImpl();
        objectCtx.put(ObjectMessageContext.MESSAGE_INPUT, Boolean.FALSE);
        objectCtx.put(MESSAGE_OUTBOUND_PROPERTY, Boolean.TRUE);
        SOAPMessageContext context = (SOAPMessageContext)sb.createBindingMessageContext(objectCtx);

        MessageFactory msgFactory = MessageFactory.newInstance();
        SOAPMessage msg = msgFactory.createMessage();
        msg.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true");
View Full Code Here

       
        if (!initialised) {
            init();
        }

        ObjectMessageContext objMsgContext = cb.createObjectContext();
        // TODO
        // RequestConetxts needed to be populated based on JAX-WS mandatory
        // properties
        // Further copied into ObjectMessageContext so as to decouple context
        // across invocations
        objMsgContext.putAll(getRequestContext());
        objMsgContext.setMessageObjects(obj);
       
        try {
            objMsgContext = cb.invoke(objMsgContext, callback);
        } catch (Exception ex) {
            throwWebServiceException(ex);
        } finally {
            //Update Response Context
            throwProtocolException(objMsgContext.getException());
        }
       
        populateResponseContext(objMsgContext);

        return cl.cast(objMsgContext.getReturn());
    }
View Full Code Here

       
        if (!initialised) {
            init();
        }  

        ObjectMessageContext objMsgContext = cb.createObjectContext();
        objMsgContext.putAll(getRequestContext());
        objMsgContext.setMessageObjects(obj);
       
        AsyncCallbackFuture future = null;
       
        try {
            Future<ObjectMessageContext> objMsgContextAsynch =
View Full Code Here

       
        if (!initialised) {
            init();
        }
       
        ObjectMessageContext objMsgContext = cb.createObjectContext();
        objMsgContext.putAll(getRequestContext());
        objMsgContext.setMessageObjects(obj);
       
        Response<T> response = null;
       
        try {
            Future<ObjectMessageContext> objMsgContextAsynch =
View Full Code Here

       
        if (!initialised) {
            init();
        }

        ObjectMessageContext objMsgContext = cb.createObjectContext();
        objMsgContext.putAll(getRequestContext());
        objMsgContext.setMessageObjects(obj);
       
        try {
            cb.invokeOneWay(objMsgContext, callback);
        } catch (Exception ex) {
            throwWebServiceException(ex);
View Full Code Here

    }

    private Object invokeSEIMethod(Object proxy, Method method, Object parameters[])
        throws Exception {

        ObjectMessageContext objMsgContext = clientBinding.createObjectContext();
        objMsgContext.putAll(getRequestContext());
       
       
        objMsgContext.put(ObjectMessageContext.REQUEST_PROXY, proxy);
      
        objMsgContext.setMessageObjects(parameters);
        objMsgContext.put(METHOD, method);
        objMsgContext.put(ObjectMessageContext.METHOD_OBJ, method);

        boolean isOneway = (method.getAnnotation(Oneway.class) != null) ? true : false;
        boolean isAsync = method.getName().endsWith("Async");

      
        if (isOneway) {
            clientBinding.invokeOneWay(objMsgContext,
                                       new JAXBDataBindingCallback(method,
                                                                   DataBindingCallback.Mode.PARTS,
                                                                   context,
                                                                   schema));
        } else if (isAsync) {        
            Future<ObjectMessageContext> objMsgContextAsynch =
                clientBinding.invokeAsync(objMsgContext,
                                          new JAXBDataBindingCallback(method,
                                                                      DataBindingCallback.Mode.PARTS,
                                                                      context,
                                                                      schema)
                                                                      , service.getExecutor());
           
            Response<?> r = new AsyncResponse<Object>(objMsgContextAsynch, Object.class);
            if (parameters.length > 0 && parameters[parameters.length - 1] instanceof AsyncHandler) {
                // callback style
                AsyncCallbackFuture f = new AsyncCallbackFuture(r,
                    (AsyncHandler)parameters[parameters.length - 1]);
                // service must always have an executor associated with it
                service.getExecutor().execute(f);
                return f;
               
               
            } else {
                return r;
            }

           
        } else {
            objMsgContext = clientBinding.invoke(objMsgContext,
                                                 new JAXBDataBindingCallback(method,
                                                                             DataBindingCallback.Mode.PARTS,
                                                                             context,
                                                                             schema));
        }

        populateResponseContext(objMsgContext);

        if (objMsgContext.getException() != null) {
            LOG.log(Level.INFO, "ENDPOINT_INVOCATION_FAILED", method.getName());
            if (isValidException(objMsgContext)) {
                throw (Exception)objMsgContext.getException();
            } else {               
                throw new ProtocolException(objMsgContext.getException());
            }
        }
       
        return objMsgContext.getReturn();
    }   
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.context.ObjectMessageContext

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.