Package org.objectweb.celtix.context

Examples of org.objectweb.celtix.context.OutputStreamMessageContext


        Request request = new Request(this, getTransport(), objectCtx);
        request.setOneway(true);

        try {
            OutputStreamMessageContext ostreamCtx = request.process(null);

            if (null != ostreamCtx) {
                // one of the (system handlers) may have indicated that it expects
                // headers to be piggybacked in the response
                // if this is the case, use the transports invoke rather than invokeOneway
View Full Code Here


        Request request = new Request(this, getTransport(), objectCtx);
        AsyncFuture asyncFuture = null;

        try {
            OutputStreamMessageContext ostreamCtx = request.process(null);

            if (null != ostreamCtx) {

                Future<InputStreamMessageContext> ins = clientTransport().invokeAsync(ostreamCtx, executor);
                asyncFuture = new AsyncFuture(ins, this, callback, request.getHandlerInvoker(), objectCtx);
View Full Code Here

                if (null == bytes) {
                    bytes = new byte[10000];
                }
                int total = readBytes(bytes, ctx.getInputStream());

                OutputStreamMessageContext octx = null;
                if (decoupled) {
                    EndpointReferenceType ref = new EndpointReferenceType();
                    EndpointReferenceUtils.setAddress(ref, DECOUPLED_ADDRESS);
                    octx = server.rebase(ctx, ref);
                    server.finalPrepareOutputStreamContext(octx);
                    octx.getOutputStream().flush();
                    octx.getOutputStream().close();
                    assertEquals(ctx.get(HTTPServerInputStreamContext.HTTP_RESPONSE), ref);
                    if (!oneWay) {
                        awaitPartialResponseReceived();
                    }
                }

                if (oneWay) {
                    octx = transport.createOutputStreamContext(ctx);
                    octx.setOneWay(oneWay);
                    transport.finalPrepareOutputStreamContext(octx);
                    octx.getOutputStream().close();
                    transport.postDispatch(ctx, octx);
                }

                // simulate implementor call
                if (delay > 0) {
                    Thread.sleep(delay);
                }

                if (!oneWay) {
                    octx = transport.createOutputStreamContext(ctx);
                    octx.setOneWay(oneWay);
                    transport.finalPrepareOutputStreamContext(octx);
                    octx.getOutputStream().write(bytes, 0, total);
                    octx.getOutputStream().flush();
                    octx.getOutputStream().close();
                    transport.postDispatch(ctx, octx);
                }
            } catch (Exception ex) {
                ex.printStackTrace();
            }
View Full Code Here

        setupCallbackObject(useAutomaticWorkQueue);
       
        server.activate(callback);
       
        TestJMSClientTransport client = createClientTransport(wsdlUrl, serviceName, portName, address);
        OutputStreamMessageContext octx =
            client.createOutputStreamContext(new GenericMessageContext());
       
        setRequestContextHeader(octx);
       
        client.finalPrepareOutputStreamContext(octx);
       
        byte outBytes[] = "Hello World!!!".getBytes();
        octx.getOutputStream().write(outBytes);
       
        // make sure that the inner context that we used to create has the same values that we inserted
        checkContextHeader(client.getContext(), JMSConstants.JMS_CLIENT_REQUEST_HEADERS);
        InputStreamMessageContext ictx = client.invoke(octx);
        byte bytes[] = new byte[10000];
View Full Code Here

        if (oneway || decoupled) {
            context.get(ONEWAY_MESSAGE_TF);
            EasyMock.expectLastCall().andReturn(Boolean.valueOf(oneway));           
            aggregator.serverBinding = control.createMock(ServerBinding.class);
            aggregator.serverTransport = control.createMock(ServerTransport.class);
            OutputStreamMessageContext outputContext =
                control.createMock(OutputStreamMessageContext.class);
            aggregator.serverTransport.rebase(context, replyTo);
            EasyMock.expectLastCall().andReturn(outputContext);
            DataBindingCallback callback =
                new JAXBDataBindingCallback(null,
View Full Code Here

TOP

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

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.