01: /*
02: * $Id: MuleMessageEOFProtocol.java 10489 2008-01-23 17:53:38Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.transport.tcp.protocols;
12:
13: import java.io.IOException;
14: import java.io.InputStream;
15: import java.io.OutputStream;
16:
17: /**
18: * This Protocol will send the actual Mule Message over the TCP channel, and in this
19: * way we are preserving any headers which might be needed, for example Correlation
20: * IDs in order to be able to aggregate messages after chunking. Data are read until
21: * the client closes the channel.
22: */
23: public class MuleMessageEOFProtocol extends EOFProtocol {
24:
25: // @Override
26: public Object read(InputStream is) throws IOException {
27: return MuleMessageWorker.doRead(super .read(is));
28: }
29:
30: // @Override
31: public void write(OutputStream os, Object unused)
32: throws IOException {
33: super.write(os, MuleMessageWorker.doWrite());
34: }
35:
36: }
|