Package org.objectweb.celtix.context

Examples of org.objectweb.celtix.context.InputStreamMessageContext


                              OutputStreamMessageContext outputStreamContext,
                              AbstractBindingImpl bindingImpl,
                              Transport transport) throws Exception {
        handlerInvoker.invokeProtocolHandlers(true, bindingContext);
        EasyMock.expectLastCall().andReturn(Boolean.TRUE);
        InputStreamMessageContext inputStreamContext =
            control.createMock(InputStreamMessageContext.class);
        ((ClientTransport)transport).invoke(outputStreamContext);
        EasyMock.expectLastCall().andReturn(inputStreamContext);
        bindingImpl.read(inputStreamContext, bindingContext);
        EasyMock.expectLastCall();
View Full Code Here


    }

    protected InputStreamMessageContext getResponseContext(
                                 HTTPClientOutputStreamContext requestContext)
        throws IOException {
        InputStreamMessageContext responseContext = null;
        if (hasDecoupledEndpoint()) {
            int responseCode = getResponseCode(requestContext.connection);
            if (responseCode == HttpURLConnection.HTTP_ACCEPTED) {
                // server transport was rebased on decoupled response endpoint,
                // dispatch this partial response immediately as it may include
View Full Code Here

     */
    private void invokePartial(Request request,
                               ClientTransport transport,
                               OutputStreamMessageContext outputStreamContext)
        throws IOException {
        InputStreamMessageContext inputStreamContext =
            transport.invoke(outputStreamContext);
        Response response = new Response(request);    
        response.processProtocol(inputStreamContext);
        response.processLogical(null);
    }
View Full Code Here

        EasyMock.replay(channel);
        EasyMock.replay(factory);
        EasyMock.replay(exchange);
        EasyMock.replay(message);
       
        InputStreamMessageContext ret =  clientTransport.invoke(outCtx);
        assertNotNull("invoke must not return null", ret);
        assertNotNull("invoke must not return an emtpy context", ret.getInputStream());

        EasyMock.verify(channel);
        EasyMock.verify(factory);
        EasyMock.verify(exchange);
        EasyMock.verify(message);
       
        BufferedReader reader = new BufferedReader(new InputStreamReader(ret.getInputStream()));
        // throw away prolog
        String s = reader.readLine();  
        assertNotNull(s);
        // chop off the XML declaration
       
View Full Code Here

       
        assertTrue("ServerTransportCallback.dispatch was not called", invokedHolder.value);
        assertSame("transport not passed to ServerTransportCallback", transport, transportHolder.value);
       
        assertNotNull("no context passed from transport", ctxHolder.value);
        InputStreamMessageContext ctx = ctxHolder.value;
        assertTrue("context is of incorrect type: " + ctx.getClass(),
                   ctx instanceof GeronimoInputStreamMessageContext);
        GeronimoInputStreamMessageContext inctx = (GeronimoInputStreamMessageContext)ctx;
        assertNotNull("request not available in context", inctx.getRequest());
       
        assertNotNull("response not available in context", inctx.getResponse());
View Full Code Here

    }

    public void testContextWithInputStream() {
       
        InputStream inStream = EasyMock.createMock(InputStream.class);
        InputStreamMessageContext inctx = EasyMock.createMock(InputStreamMessageContext.class);
       
        inctx.getInputStream();
        org.easymock.EasyMock.expectLastCall().andReturn(inStream);

        StreamMessageContext ctx = new StreamMessageContextImpl(inctx);
       
        EasyMock.replay(inctx);
        assertSame(inStream, ctx.getInputStream());
        EasyMock.verify(inctx);

        EasyMock.reset(inctx);
        InputStream in2 = EasyMock.createMock(InputStream.class);
        inctx.setInputStream(in2);
        EasyMock.replay(inctx);
        ctx.setInputStream(in2);

        EasyMock.verify(inctx);
View Full Code Here

                    ostreamCtx.getOutputStream().close();
                    ostreamCtx.getCorrespondingInputStreamContext().getInputStream().close();
                } else {
                    ostreamCtx.getOutputStream().close();
                    // handle partial reponse
                    InputStreamMessageContext istreamCtx =
                        ostreamCtx.getCorrespondingInputStreamContext();
                    Response response = new Response(request);    
                    response.processProtocol(istreamCtx);
                    response.processLogical(null);
                }
View Full Code Here

    }


    public void testContextWithInputStreamInvokeOutputStream() {

        InputStreamMessageContext inctx = EasyMock.createMock(InputStreamMessageContext.class);
        StreamMessageContext ctx = new StreamMessageContextImpl(inctx);

        try {
            ctx.getOutputStream();
            fail("did not get expected exception");
View Full Code Here

        callback = cback;
        context = ctx;
    }
   
    public synchronized ObjectMessageContext get() throws InterruptedException, ExecutionException {
        InputStreamMessageContext ins = futureInputStreamMsgContext.get();
        return absClientBinding.getObjectMessageContextAsync(ins, handlerInvoker, callback, context);
    }
View Full Code Here

        return futureInputStreamMsgContext.cancel(mayInterruptIfRunning);
    }

    public ObjectMessageContext get(long timeout, TimeUnit unit)
        throws InterruptedException, ExecutionException, TimeoutException {
        InputStreamMessageContext ins = futureInputStreamMsgContext.get(timeout, unit);
        return absClientBinding.getObjectMessageContextAsync(ins, handlerInvoker, callback, context);
    }
View Full Code Here

TOP

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

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.