Package org.objectweb.celtix.context

Examples of org.objectweb.celtix.context.GenericMessageContext


        WebServiceContextImpl wsci = new WebServiceContextImpl();
        assertNull(wsci.getMessageContext());

       
        final MessageContext ctx = new GenericMessageContext();
        WebServiceContextImpl.setMessageContext(ctx);

        assertSame(ctx, wsci.getMessageContext());

        Thread t = new Thread() {
                public void run() {
                    WebServiceContextImpl threadLocalWSCI = new WebServiceContextImpl();

                    assertNull(threadLocalWSCI.getMessageContext());

                    MessageContext threadLocalCtx = new GenericMessageContext();
                    WebServiceContextImpl.setMessageContext(threadLocalCtx);


                    assertSame(threadLocalCtx, threadLocalWSCI.getMessageContext());
                    assertTrue(ctx !=  threadLocalWSCI.getMessageContext());
View Full Code Here


public class GenericMessageContextTest extends AbstractMessageContextTestBase {

    @Override
    protected MessageContext getMessageContext() {
        // TODO Auto-generated method stub
        return new GenericMessageContext();
    }
View Full Code Here

    public void testRead() throws Exception {
        TestClientBinding clientBinding = new TestClientBinding(bus, epr);
        InputStream is =  getClass().getResourceAsStream("resources/SayHiWrappedResp.xml");
        TestInputStreamContext tisc = new TestInputStreamContext(null);
        tisc.setInputStream(is);
        XMLMessageContext xmlContext = new XMLMessageContextImpl(new GenericMessageContext());       
        clientBinding.getBindingImpl().read(tisc,  xmlContext);

        assertNotNull(xmlContext.getMessage());

        is =  getClass().getResourceAsStream("resources/SayHiWrappedResp.xml");
View Full Code Here

       
        BufferedReader br = new BufferedReader(new InputStreamReader(getClass().
                                                                     getResourceAsStream(resource)));
        String expectString = br.readLine();
       
        XMLMessageContext xmlContext = new XMLMessageContextImpl(new GenericMessageContext());
        xmlContext.setMessage(greetMeMsg);
       
        TestOutputStreamContext tosc = new TestOutputStreamContext(null, xmlContext);
        clientBinding.getBindingImpl().write(xmlContext, tosc);
View Full Code Here

    public HandlerInvoker createHandlerInvoker() {
        return new HandlerChainInvoker(getHandlerChain(true));
    }
   
    public MessageContext createBindingMessageContext(MessageContext orig) {
        MessageContext bindingCtx = new GenericMessageContext();
        if (null != orig) {
            bindingCtx.putAll(orig);
        }
        return bindingCtx;
    }
View Full Code Here

        return null;
    }

    public OutputStreamMessageContext createOutputStreamContext(MessageContext context)
        throws IOException {
        return new ToyOutputStreamMessageContext(new GenericMessageContext());
    }
View Full Code Here

    public InputStreamMessageContext doClientInvoke(ClientTransport client,
                                                    OutputStreamMessageContext octx,
                                                    byte[] outBytes,
                                                    boolean insertContextInfo)
        throws Exception {
        octx = client.createOutputStreamContext(new GenericMessageContext());
        client.finalPrepareOutputStreamContext(octx);
        octx.getOutputStream().write(outBytes);
        if (insertContextInfo) {
            insertContextInfo(octx);
        }
View Full Code Here

                        (JMSOutputStreamContext)transport.createOutputStreamContext(ctx);
                    octx.setOneWay(true);
                    transport.finalPrepareOutputStreamContext(octx);
                    serverRcvdInOneWayCall = new String(bytes);

                    MessageContext replyCtx = new GenericMessageContext();
                    ctx.put("ObjectMessageContext.MESSAGE_INPUT", Boolean.TRUE);
                    replyCtx.putAll(ctx);
                    replyCtx.put("ObjectMessageContext.MESSAGE_INPUT", Boolean.TRUE);

                    ((JMSServerTransport)transport).postDispatch(replyCtx, octx);
                    octx.getOutputStream().close();
                } catch (Exception ex) {
                    ex.printStackTrace();
View Full Code Here

       
        assertTrue("targetEndpoint address mismatch. Expected : " + address
                   + "  received : " + client.getTargetEndpoint(),
                   address.equals(client.getTargetEndpoint().getAddress().getValue()));
        OutputStreamMessageContext octx =
            client.createOutputStreamContext(new GenericMessageContext());
        client.finalPrepareOutputStreamContext(octx);
        byte outBytes[] = "Hello World!!!".getBytes();
        octx.getOutputStream().write(outBytes);
        client.invokeOneway(octx);
        Thread.sleep(500L);
View Full Code Here

        server.deactivate();
        outBytes = "HelloWorld".getBytes();

        try {
            OutputStreamMessageContext octx = client.createOutputStreamContext(new GenericMessageContext());
            client.finalPrepareOutputStreamContext(octx);
            octx.getOutputStream().write(outBytes);
            octx.getOutputStream().close();
            InputStreamMessageContext ictx = client.invoke(octx);
            byte bytes[] = new byte[10000];
View Full Code Here

TOP

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

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.