Package org.apache.tuscany.sca.binding.notification.util.IOUtils

Examples of org.apache.tuscany.sca.binding.notification.util.IOUtils.Writeable


    public Message invoke(Message msg) {
        Object payload = msg.getBody();
        if (payload == null) {
            throw new RuntimeException("Message body is null");
        }
        Writeable writeable = null;
        String incomingBrokerID = null;
        if (payload.getClass().isArray()) {
            Object[] bodyArray = (Object[])payload;
            if (bodyArray.length == 3) {
                writeable = getWriteableFromByteArray((byte[])bodyArray[1]);
View Full Code Here


    private Writeable getWriteableFromPayload(Object payload) throws RuntimeException {
        if (!(payload instanceof OMElement)) {
            throw new RuntimeException("payload not OMElement");
        }
        final OMElement element = (OMElement)payload;
        Writeable writeable = new Writeable() {
            public void write(OutputStream os) throws IOUtilsException {
                try {
                    element.serialize(os);
                    os.flush();
                } catch(Exception e) {
View Full Code Here

        };
        return writeable;
    }

    private Writeable getWriteableFromByteArray(final byte[] payload) {
        Writeable writeable = new Writeable() {
            public void write(OutputStream os) throws IOUtilsException {
                try {
                    os.write(payload);
                    os.flush();
                } catch(Exception e) {
View Full Code Here

    public Message invoke(Message msg) {
        Object payload = msg.getBody();
        if (payload == null) {
            throw new RuntimeException("Message body is null");
        }
        Writeable writeable = null;
        String incomingBrokerID = null;
        if (payload.getClass().isArray()) {
            Object[] bodyArray = (Object[])payload;
            if (bodyArray.length == 3) {
                writeable = getWriteableFromByteArray((byte[])bodyArray[1]);
View Full Code Here

    private Writeable getWriteableFromPayload(Object payload) throws RuntimeException {
        if (!(payload instanceof OMElement)) {
            throw new RuntimeException("payload not OMElement");
        }
        final OMElement element = (OMElement)payload;
        Writeable writeable = new Writeable() {
            public void write(OutputStream os) throws IOUtilsException {
                try {
                    element.serialize(os);
                    os.flush();
                }
View Full Code Here

        };
        return writeable;
    }

    private Writeable getWriteableFromByteArray(final byte[] payload) {
        Writeable writeable = new Writeable() {
            public void write(OutputStream os) throws IOUtilsException {
                try {
                    os.write(payload);
                    os.flush();
                }
View Full Code Here

    public Message invoke(Message msg) {
        Object payload = msg.getBody();
        if (payload == null) {
            throw new RuntimeException("Message body is null");
        }
        Writeable writeable = null;
        String incomingBrokerID = null;
        if (payload.getClass().isArray()) {
            Object[] bodyArray = (Object[])payload;
            if (bodyArray.length == 3) {
                writeable = getWriteableFromByteArray((byte[])bodyArray[1]);
View Full Code Here

    private Writeable getWriteableFromPayload(Object payload) throws RuntimeException {
        if (!(payload instanceof OMElement)) {
            throw new RuntimeException("payload not OMElement");
        }
        final OMElement element = (OMElement)payload;
        Writeable writeable = new Writeable() {
            public void write(OutputStream os) throws IOUtilsException {
                try {
                    element.serialize(os);
                    os.flush();
                }
View Full Code Here

        };
        return writeable;
    }

    private Writeable getWriteableFromByteArray(final byte[] payload) {
        Writeable writeable = new Writeable() {
            public void write(OutputStream os) throws IOUtilsException {
                try {
                    os.write(payload);
                    os.flush();
                }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.notification.util.IOUtils.Writeable

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.