View Javadoc

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