Package org.mule.api.transformer.wire

Examples of org.mule.api.transformer.wire.WireFormat


    }

    protected Object readWrite(Object inObject) throws Exception
    {
        // Serialize
        WireFormat wireFormat = getWireFormat();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        wireFormat.write(out, inObject, "UTF-8");

        // De-serialize
        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        Object outMessage = wireFormat.read(in);
        assertNotNull(outMessage);
        return outMessage;
    }
View Full Code Here


            throw new RemoteDispatcherException(ClientMessages.failedToDeserializeHandshakeFromServer(), e);
        }

        try
        {
            WireFormat wf = (WireFormat)ClassUtils.instanciateClass(handshake.getWireFormatClass(),
                    ClassUtils.NO_ARGS, getClass());

            wf.setMuleContext(muleContext);
            return wf;
        }
        catch (Exception e)
        {
            throw new UnsupportedWireFormatException(handshake.getWireFormatClass(), e);
View Full Code Here

            throw new RemoteDispatcherException(ClientMessages.failedToDeserializeHandshakeFromServer(), e);
        }

        try
        {
            WireFormat wf = (WireFormat)ClassUtils.instanciateClass(handshake.getWireFormatClass(),
                    ClassUtils.NO_ARGS, getClass());

            wf.setMuleContext(muleContext);
            return wf;
        }
        catch (Exception e)
        {
            throw new UnsupportedWireFormatException(handshake.getWireFormatClass(), e);
View Full Code Here

    }

    protected Object readWrite(Object inObject) throws Exception
    {
        // Serialize
        WireFormat wireFormat = getWireFormat();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        wireFormat.write(out, inObject, "UTF-8");

        // De-serialize
        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        Object outMessage = wireFormat.read(in);
        assertNotNull(outMessage);
        return outMessage;
    }
View Full Code Here

    {
        Socket clientSocket = new Socket(host, port);
        DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        WireFormat wireFormat = new SerializedMuleMessageWireFormat();
        wireFormat.setMuleContext(muleContext);
        wireFormat.write(baos, msg, msg.getEncoding());
        TcpProtocol delegate = createMuleMessageProtocol();
        delegate.write(outToServer, baos.toByteArray());
        clientSocket.close();
    }
View Full Code Here

TOP

Related Classes of org.mule.api.transformer.wire.WireFormat

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.