You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ve...@apache.org on 2009/05/30 00:16:08 UTC

svn commit: r780126 - in /webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core: Connection.java IRequestResponse.java

Author: veithen
Date: Fri May 29 22:16:07 2009
New Revision: 780126

URL: http://svn.apache.org/viewvc?rev=780126&view=rev
Log:
Documentation update and minor generalization.

Modified:
    webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/Connection.java
    webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/IRequestResponse.java

Modified: webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/Connection.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/Connection.java?rev=780126&r1=780125&r2=780126&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/Connection.java (original)
+++ webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/Connection.java Fri May 29 22:16:07 2009
@@ -147,7 +147,10 @@
             // We log the request data at this stage. This means that the user will see the request
             // as if it had been sent directly from the client to the server (without TCPMon or a proxy
             // in between).
-            requestPipeline.addFilter(new Tee(requestResponse.getRequestOutputStream()));
+            OutputStream requestOutputStream = requestResponse.getRequestOutputStream();
+            if (requestOutputStream != null) {
+                requestPipeline.addFilter(new Tee(requestOutputStream));
+            }
             if (HTTPProxyHost != null) {
                 requestFilter.addHandler(new HttpProxyClientHandler(targetHost, targetPort));
                 outSocket = socketFactory.createSocket(HTTPProxyHost, HTTPProxyPort);
@@ -176,7 +179,10 @@
             if (tmpOut1 != null) {
                 responsePipeline.addFilter(new Tee(tmpOut1));
             }
-            responsePipeline.addFilter(new Tee(requestResponse.getResponseOutputStream()));
+            OutputStream responseOutputStream = requestResponse.getResponseOutputStream();
+            if (responseOutputStream != null) {
+                responsePipeline.addFilter(new Tee(responseOutputStream));
+            }
             
             // this is the channel to the endpoint
             rr1 = new SocketRR(this, inSocket, tmpIn1, outSocket, tmpOut2, requestPipeline);

Modified: webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/IRequestResponse.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/IRequestResponse.java?rev=780126&r1=780125&r2=780126&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/IRequestResponse.java (original)
+++ webservices/commons/trunk/modules/tcpmon/modules/tcpmon-core/src/main/java/org/apache/ws/commons/tcpmon/core/IRequestResponse.java Fri May 29 22:16:07 2009
@@ -31,7 +31,22 @@
     void setTarget(String targetHost, int targetPort);
     void setState(int state);
     void setElapsed(long elapsed);
+    
+    /**
+     * Get the output stream to which a copy of the request will be written.
+     * 
+     * @return an output stream or <code>null</code> if the implementation doesn't
+     *         want to receive a copy of the request
+     */
     OutputStream getRequestOutputStream();
+    
+    /**
+     * Get the output stream to which a copy of the response will be written
+     * 
+     * @return an output stream or <code>null</code> if the implementation doesn't
+     *         want to receive a copy of the response
+     */
     OutputStream getResponseOutputStream();
+    
     void onError(Throwable ex);
 }