Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
TcpInputStream |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com | |
3 | * The software in this package is published under the terms of the CPAL v1.0 | |
4 | * license, a copy of which has been included with this distribution in the | |
5 | * LICENSE.txt file. | |
6 | */ | |
7 | package org.mule.transport.tcp; | |
8 | ||
9 | import org.mule.model.streaming.DelegatingInputStream; | |
10 | ||
11 | import java.io.InputStream; | |
12 | ||
13 | /** | |
14 | * The {@link TcpMessageDispatcher} and the {@link TcpMessageReceiver} use this | |
15 | * class as the input parameter to the read() method on the {@link TcpProtocol} | |
16 | * interface. If you wish to simply use the InputStream as the message payload | |
17 | * that you're reading in, you just call tcpInputStream.setStreaming(true) so | |
18 | * that Mule knows to stop listening for more messages on that stream. | |
19 | */ | |
20 | public class TcpInputStream extends DelegatingInputStream | |
21 | { | |
22 | private boolean streaming; | |
23 | ||
24 | public TcpInputStream(InputStream delegate) | |
25 | { | |
26 | 0 | super(delegate); |
27 | 0 | } |
28 | ||
29 | public boolean isStreaming() | |
30 | { | |
31 | 0 | return streaming; |
32 | } | |
33 | ||
34 | public void setStreaming(boolean streaming) | |
35 | { | |
36 | 0 | this.streaming = streaming; |
37 | 0 | } |
38 | ||
39 | } | |
40 | ||
41 |