View Javadoc
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;
8   
9   import java.io.BufferedOutputStream;
10  import java.io.IOException;
11  import java.io.OutputStream;
12  import java.net.Socket;
13  
14  /**
15   * <code>ResponseOutputStream</code> is an output stream associated with the
16   * currently received event. Note that if the stream is from a socket the socket is
17   * also available on this stream so that the socket state can be validated before
18   * writing.
19   */
20  
21  public class ResponseOutputStream extends BufferedOutputStream
22  {
23  
24      private Socket socket = null;
25  
26      public ResponseOutputStream(OutputStream stream)
27      {
28          super(stream);
29      }
30  
31      public ResponseOutputStream(Socket socket, OutputStream stream) throws IOException
32      {
33          super(stream);
34          this.socket = socket;
35      }
36  
37      public Socket getSocket()
38      {
39          return socket;
40      }
41  
42  }