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 aj...@apache.org on 2006/03/26 17:21:57 UTC
svn commit: r388914 - in /webservices/commons/trunk/modules/tcpmon: ./
scripts/ src/org/apache/ws/commons/tcpmon/
src/org/apache/ws/commons/tracer/ xdocs/ xdocs/images/
Author: ajith
Date: Sun Mar 26 07:21:54 2006
New Revision: 388914
URL: http://svn.apache.org/viewcvs?rev=388914&view=rev
Log:
1.Added the necessary xdocs to tcpmon
2.refactored the packages and renamed the main class to TCPMon
3.Added necessary goals to build the bin and src distributions
Note - for some unknown reason "maven site" fails for me.
Added:
webservices/commons/trunk/modules/tcpmon/maven.xml
webservices/commons/trunk/modules/tcpmon/scripts/
webservices/commons/trunk/modules/tcpmon/scripts/tcpmon.bat
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/
- copied from r388902, webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tracer/
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/TCPMon.java
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/tcpmon.properties
webservices/commons/trunk/modules/tcpmon/xdocs/
webservices/commons/trunk/modules/tcpmon/xdocs/images/
webservices/commons/trunk/modules/tcpmon/xdocs/images/Thumbs.db (with props)
webservices/commons/trunk/modules/tcpmon/xdocs/images/concept.jpg (with props)
webservices/commons/trunk/modules/tcpmon/xdocs/images/screen1.jpg (with props)
webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2-browser.jpg (with props)
webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2-closeup1.jpg (with props)
webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2-closeup2.jpg (with props)
webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2.jpg (with props)
webservices/commons/trunk/modules/tcpmon/xdocs/images/screen3.jpg (with props)
webservices/commons/trunk/modules/tcpmon/xdocs/images/screen4.jpg (with props)
webservices/commons/trunk/modules/tcpmon/xdocs/images/screen5.jpg (with props)
webservices/commons/trunk/modules/tcpmon/xdocs/images/screen6.jpg (with props)
webservices/commons/trunk/modules/tcpmon/xdocs/navigation.xml
webservices/commons/trunk/modules/tcpmon/xdocs/tcpmontutorial.html
Removed:
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/HTTPTracer.java
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/httptracer.properties
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tracer/
Modified:
webservices/commons/trunk/modules/tcpmon/project.properties
webservices/commons/trunk/modules/tcpmon/project.xml
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/AdminPane.java
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Connection.java
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Listener.java
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Relay.java
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Sender.java
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/SlowLinkSimulator.java
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/SocketRR.java
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/SocketWaiter.java
webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/TcpTunnel.java
Added: webservices/commons/trunk/modules/tcpmon/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/maven.xml?rev=388914&view=auto
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/maven.xml (added)
+++ webservices/commons/trunk/modules/tcpmon/maven.xml Sun Mar 26 07:21:54 2006
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- $Revision: 1.21 $ $Date: 2004-10-27 20:54:09 +0600 (Wed, 27 Oct 2004) $ -->
+<project default="jar" xmlns:j="jelly:core" xmlns:u="jelly:util" xmlns:maven="jelly:maven" xmlns:util="jelly:util" xmlns:deploy="deploy" xmlns:ant="jelly:ant">
+ <j:set var="javadoc.dir" value="target/apidocs"/>
+ <j:set var="site.javadoc.dir" value="target/docs/apidocs"/>
+ <!-- create javadocs as a post goal to the site and copy them to the
+ target/docs folder -->
+ <!-- goal to make the javadocs -->
+ <goal name="javadocs">
+ <ant:echo>+----------------------------------------------</ant:echo>
+ <ant:echo>| Generating Java docs </ant:echo>
+ <ant:echo>+----------------------------------------------</ant:echo>
+ <mkdir dir="${javadoc.dir}"/>
+ <ant:javadoc packagenames="org.apache.ws.commons.*" defaultexcludes="yes" destdir="${javadoc.dir}" author="true" breakiterator="true" version="true" use="true" windowtitle="TCPMon API">
+ <ant:arg line="-J-Dhttp.proxy.port=${maven.proxy.port} -J-Dhttp.proxy.host=${maven.proxy.host}"/>
+ <ant:sourcepath>
+ <ant:pathelement location="src"/>
+ </ant:sourcepath>
+ </ant:javadoc>
+ </goal>
+ <!--<postGoal name="site">
+ <attainGoal name="javadocs"/>
+ <ant:copy toDir="${site.javadoc.dir}">
+ <ant:fileset dir="${javadoc.dir}"/>
+ </ant:copy>
+ </postGoal>-->
+ <!-- create the binary distribution -->
+ <goal name="dist-bin" prereqs="jar,javadocs">
+ <ant:echo>+----------------------------------------------</ant:echo>
+ <ant:echo>| Creating: TCPMon Binary Distribution</ant:echo>
+ <ant:echo>+----------------------------------------------</ant:echo>
+ <property name="dist" value="target/dist/temp"/>
+ <mkdir dir="${dist}"/>
+ <mkdir dir="${dist}/apidocs"/>
+ <mkdir dir="${dist}/build"/>
+ <mkdir dir="${dist}/docs"/>
+ <!--we have no dependent jars-->
+ <!--copy api docs-->
+ <ant:copy toDir="${dist}/apidocs">
+ <ant:fileset dir="${javadoc.dir}"/>
+ </ant:copy>
+ <!--add the jar-->
+ <ant:copy toDir="${dist}/build">
+ <ant:fileset file="target/tcpmon-${tcpmon.version}.jar"/>
+ </ant:copy>
+ <!-- add scripts-->
+ <ant:copy toDir="${dist}/build">
+ <ant:fileset dir="scripts">
+ <ant:exclude name="**/.svn/**"/>
+ </ant:fileset>
+ </ant:copy>
+ <!--add other documents in Xdocs-->
+ <ant:copy toDir="${dist}/docs">
+ <ant:fileset dir="xdocs">
+ <ant:exclude name="**/.svn/**"/>
+ </ant:fileset>
+ </ant:copy>
+ <!--copy release notes, etc-->
+ <ant:copy toDir="${dist}">
+ <ant:fileset file="RELEASE-NOTE.txt"/>
+ <ant:fileset file="README.txt"/>
+ <ant:fileset file="LICENSE.txt"/>
+ </ant:copy>
+ <!--create the zip-->
+ <ant:zip file="target/dist/tcpmon-${tcpmon.version}-bin.zip">
+ <ant:fileset dir="${dist}/"/>
+ </ant:zip>
+ <ant:delete dir="${dist}"/>
+ </goal>
+ <!-- code to create the source distribution -->
+ <goal name="dist-src">
+ <ant:echo>+----------------------------------------------</ant:echo>
+ <ant:echo>| Creating: TCPMon Source Distribution</ant:echo>
+ <ant:echo>+----------------------------------------------</ant:echo>
+ <ant:property name="dist" value="target/dist/temp"/>
+ <ant:copy toDir="${dist}">
+ <ant:fileset dir=".">
+ <ant:exclude name="**/.svn/**"/>
+ <ant:include name="**/src/**"/>
+ <ant:include name="**/test/**"/>
+ </ant:fileset>
+ </ant:copy>
+ <!-- Copy the master maven files src distro -->
+ <ant:copy toDir="${dist}">
+ <ant:fileset file="maven.xml"/>
+ <ant:fileset file="project.xml"/>
+ <ant:fileset file="project.properties"/>
+ <ant:fileset file="RELEASE-NOTE.txt"/>
+ <ant:fileset file="LICENSE.txt"/>
+ </ant:copy>
+ <!-- Zip up -->
+ <ant:zip file="target/dist/tcpmon-${tcpmon.version}-src.zip">
+ <ant:fileset dir="${dist}/"/>
+ </ant:zip>
+ <ant:delete dir="${dist}"/>
+ </goal>
+ <!-- dummy goal to create both the bin and source distributions -->
+ <goal name="release" prereqs="dist-bin,dist-src"/>
+</project>
Modified: webservices/commons/trunk/modules/tcpmon/project.properties
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/project.properties?rev=388914&r1=388913&r2=388914&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/project.properties (original)
+++ webservices/commons/trunk/modules/tcpmon/project.properties Sun Mar 26 07:21:54 2006
@@ -42,7 +42,7 @@
maven.xdoc.date=left
maven.xdoc.version=${pom.currentVersion}
maven.xdoc.includeProjectDocumentation=no
-maven.html2xdoc.enabled=false
+maven.html2xdoc.enabled=true
maven.html2xdoc.dir=./xdocs
maven.pdf.navigationFile=navigation-pdf.xml
maven.allreports.disable=true
Modified: webservices/commons/trunk/modules/tcpmon/project.xml
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/project.xml?rev=388914&r1=388913&r2=388914&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/project.xml (original)
+++ webservices/commons/trunk/modules/tcpmon/project.xml Sun Mar 26 07:21:54 2006
@@ -24,7 +24,7 @@
<id>tcpmon</id>
<groupId>ws-commons</groupId>
<package>org.apache.ws.commons.tcpmon</package>
- <currentVersion>${tracer.version}</currentVersion>
+ <currentVersion>${tcpmon.version}</currentVersion>
<!-- details about the organization that 'owns' the project -->
<organization>
<name>Apache Software Foundation</name>
@@ -35,7 +35,7 @@
<logo>http://www.apache.org/images/asf-logo.gif</logo>
<description>TCPMon is a utility that allows the messages to be viewed and resent. It is very much useful
as a debug tool. It has originally being part of Axis1</description>
- <shortDescription>HTTPTracer</shortDescription>
+ <shortDescription>TCPMon</shortDescription>
<!-- the project home page -->
<url>http://ws.apache.org/commons/tcpmon</url>
<issueTrackingUrl>http://issues.apache.org/jira/browse/WS-Commons</issueTrackingUrl>
@@ -164,22 +164,6 @@
</developers>
<contributors>
-
- <contributor>
- <name>Anushka Kumara</name>
- <email>anushkakumar AT gmail.com</email>
- <organization>Lanka Software Foundation / University of Moratuwa</organization>
- </contributor>
- <contributor>
- <name>Chinthaka Thilakarathne</name>
- <email/>
- <organization>Lanka Software Foundation / University of Moratuwa</organization>
- </contributor>
- <contributor>
- <name>Dharshana Dias</name>
- <email/>
- <organization>Lanka Software Foundation / University of Moratuwa</organization>
- </contributor>
<contributor>
<name>Chatra Nakkawita</name>
<email>chatra AT WSO2.com</email>
@@ -190,16 +174,8 @@
<build>
- <nagEmailAddress></nagEmailAddress>
+ <nagEmailAddress>commons-dev@ws.apache.org</nagEmailAddress>
<sourceDirectory>src</sourceDirectory>
</build>
-
- <reports>
- <!-- no reports for this -->
- </reports>
-
- <dependencies>
- <!-- No external dependencies -->
- </dependencies>
</project>
Added: webservices/commons/trunk/modules/tcpmon/scripts/tcpmon.bat
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/scripts/tcpmon.bat?rev=388914&view=auto
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/scripts/tcpmon.bat (added)
+++ webservices/commons/trunk/modules/tcpmon/scripts/tcpmon.bat Sun Mar 26 07:21:54 2006
@@ -0,0 +1 @@
+java -cp ./tcpmon-0.9-SNAPSHOT.jar org.apache.ws.commons.tcpmon.TCPMon %*
Modified: webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/AdminPane.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/AdminPane.java?rev=388914&r1=388902&r2=388914&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/AdminPane.java (original)
+++ webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/AdminPane.java Sun Mar 26 07:21:54 2006
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.apache.ws.commons.tracer;
+package org.apache.ws.commons.tcpmon;
import javax.swing.Box;
import javax.swing.ButtonGroup;
@@ -125,8 +125,8 @@
mainPane = new JPanel(layout);
c.anchor = GridBagConstraints.WEST;
c.gridwidth = GridBagConstraints.REMAINDER;
- mainPane.add(new JLabel(HTTPTracer.getMessage("newTCP00",
- "Create a new HTTP tracer...")
+ mainPane.add(new JLabel(TCPMon.getMessage("newTCP00",
+ "Create a new TCPMon...")
+ " "), c);
// Add some blank space
@@ -137,7 +137,7 @@
JPanel tmpPanel = new JPanel(new GridBagLayout());
c.anchor = GridBagConstraints.WEST;
c.gridwidth = 1;
- tmpPanel.add(new JLabel(HTTPTracer.getMessage("listenPort00",
+ tmpPanel.add(new JLabel(TCPMon.getMessage("listenPort00",
"Listen Port #")
+ " "), c);
c.anchor = GridBagConstraints.WEST;
@@ -150,13 +150,13 @@
ButtonGroup btns = new ButtonGroup();
c.anchor = GridBagConstraints.WEST;
c.gridwidth = GridBagConstraints.REMAINDER;
- mainPane.add(new JLabel(HTTPTracer.getMessage("actAs00", "Act as a...")), c);
+ mainPane.add(new JLabel(TCPMon.getMessage("actAs00", "Act as a...")), c);
// Target Host/Port section
// /////////////////////////////////////////////////////////////////
c.anchor = GridBagConstraints.WEST;
c.gridwidth = GridBagConstraints.REMAINDER;
- final String listener = HTTPTracer.getMessage("listener00", "Listener");
+ final String listener = TCPMon.getMessage("listener00", "Listener");
mainPane.add(listenerButton = new JRadioButton(listener), c);
btns.add(listenerButton);
listenerButton.setSelected(true);
@@ -179,31 +179,31 @@
c.gridwidth = 1;
mainPane.add(Box.createRigidArea(new Dimension(25, 0)));
mainPane.add(hostLabel =
- new JLabel(HTTPTracer.getMessage("targetHostname00",
+ new JLabel(TCPMon.getMessage("targetHostname00",
"Target Hostname")
+ " "), c);
c.anchor = GridBagConstraints.WEST;
c.gridwidth = GridBagConstraints.REMAINDER;
host = new HostnameField(30);
mainPane.add(host, c);
- host.setText(HTTPTracer.DEFAULT_HOST);
+ host.setText(TCPMon.DEFAULT_HOST);
c.anchor = GridBagConstraints.WEST;
c.gridwidth = 1;
mainPane.add(Box.createRigidArea(new Dimension(25, 0)));
mainPane.add(tportLabel =
- new JLabel(HTTPTracer.getMessage("targetPort00", "Target Port #")
+ new JLabel(TCPMon.getMessage("targetPort00", "Target Port #")
+ " "), c);
c.anchor = GridBagConstraints.WEST;
c.gridwidth = GridBagConstraints.REMAINDER;
tport = new NumberField(4);
mainPane.add(tport, c);
- tport.setValue(HTTPTracer.DEFAULT_PORT);
+ tport.setValue(TCPMon.DEFAULT_PORT);
// Act as proxy section
// /////////////////////////////////////////////////////////////////
c.anchor = GridBagConstraints.WEST;
c.gridwidth = GridBagConstraints.REMAINDER;
- final String proxy = HTTPTracer.getMessage("proxy00", "Proxy");
+ final String proxy = TCPMon.getMessage("proxy00", "Proxy");
mainPane.add(proxyButton = new JRadioButton(proxy), c);
btns.add(proxyButton);
proxyButton.addActionListener(new ActionListener() {
@@ -231,7 +231,7 @@
// Options section
// /////////////////////////////////////////////////////////////////
JPanel opts = new JPanel(new GridBagLayout());
- opts.setBorder(new TitledBorder(HTTPTracer.getMessage("options00",
+ opts.setBorder(new TitledBorder(TCPMon.getMessage("options00",
"Options")));
c.anchor = GridBagConstraints.WEST;
c.gridwidth = GridBagConstraints.REMAINDER;
@@ -241,13 +241,13 @@
// /////////////////////////////////////////////////////////////////
c.anchor = GridBagConstraints.WEST;
c.gridwidth = GridBagConstraints.REMAINDER;
- final String proxySupport = HTTPTracer.getMessage("proxySupport00",
+ final String proxySupport = TCPMon.getMessage("proxySupport00",
"HTTP Proxy Support");
opts.add(HTTPProxyBox = new JCheckBox(proxySupport), c);
c.anchor = GridBagConstraints.WEST;
c.gridwidth = 1;
opts.add(HTTPProxyHostLabel =
- new JLabel(HTTPTracer.getMessage("hostname00", "Hostname") + " "),
+ new JLabel(TCPMon.getMessage("hostname00", "Hostname") + " "),
c);
HTTPProxyHostLabel.setForeground(Color.gray);
c.anchor = GridBagConstraints.WEST;
@@ -257,7 +257,7 @@
c.anchor = GridBagConstraints.WEST;
c.gridwidth = 1;
opts.add(HTTPProxyPortLabel =
- new JLabel(HTTPTracer.getMessage("port00", "Port #") + " "), c);
+ new JLabel(TCPMon.getMessage("port00", "Port #") + " "), c);
HTTPProxyPortLabel.setForeground(Color.gray);
c.anchor = GridBagConstraints.WEST;
c.gridwidth = GridBagConstraints.REMAINDER;
@@ -309,14 +309,14 @@
opts.add(Box.createRigidArea(new Dimension(1, 10)), c);
c.anchor = GridBagConstraints.WEST;
c.gridwidth = GridBagConstraints.REMAINDER;
- final String delaySupport = HTTPTracer.getMessage("delay00",
+ final String delaySupport = TCPMon.getMessage("delay00",
"Simulate Slow Connection");
opts.add(delayBox = new JCheckBox(delaySupport), c);
// bytes per pause
c.anchor = GridBagConstraints.WEST;
c.gridwidth = 1;
- delayBytesLabel = new JLabel(HTTPTracer.getMessage("delay01",
+ delayBytesLabel = new JLabel(TCPMon.getMessage("delay01",
"Bytes per Pause"));
opts.add(delayBytesLabel, c);
delayBytesLabel.setForeground(Color.gray);
@@ -328,7 +328,7 @@
// delay interval
c.anchor = GridBagConstraints.WEST;
c.gridwidth = 1;
- delayTimeLabel = new JLabel(HTTPTracer.getMessage("delay02",
+ delayTimeLabel = new JLabel(TCPMon.getMessage("delay02",
"Delay in Milliseconds"));
opts.add(delayTimeLabel, c);
delayTimeLabel.setForeground(Color.gray);
@@ -361,7 +361,7 @@
// /////////////////////////////////////////////////////////////////
c.anchor = GridBagConstraints.WEST;
c.gridwidth = GridBagConstraints.REMAINDER;
- final String add = HTTPTracer.getMessage("add00", "Add");
+ final String add = TCPMon.getMessage("add00", "Add");
mainPane.add(addButton = new JButton(add), c);
this.add(new JScrollPane(mainPane), BorderLayout.CENTER);
Modified: webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Connection.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Connection.java?rev=388914&r1=388902&r2=388914&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Connection.java (original)
+++ webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Connection.java Sun Mar 26 07:21:54 2006
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.apache.ws.commons.tracer;
+package org.apache.ws.commons.tcpmon;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
@@ -191,13 +191,13 @@
} else {
fromHost = "resend";
}
- String dateformat = HTTPTracer.getMessage("dateformat00", "yyyy-MM-dd HH:mm:ss");
+ String dateformat = TCPMon.getMessage("dateformat00", "yyyy-MM-dd HH:mm:ss");
DateFormat df = new SimpleDateFormat(dateformat);
time = df.format(new Date());
int count = listener.connections.size();
listener.tableModel.insertRow(count + 1,
new Object[]{
- HTTPTracer.getMessage("active00","Active"),
+ TCPMon.getMessage("active00","Active"),
time,
fromHost,
listener.hostField.getText(),
@@ -281,7 +281,7 @@
}
listener.tableModel.setValueAt(targetHost,
index + 1,
- HTTPTracer.OUTHOST_COLUMN);
+ TCPMon.OUTHOST_COLUMN);
bufferedData = bufferedData.substring(0, start)
+ url.getFile()
+ bufferedData.substring(end);
@@ -290,7 +290,7 @@
+ targetPort + "/" + urlString);
listener.tableModel.setValueAt(targetHost,
index + 1,
- HTTPTracer.OUTHOST_COLUMN);
+ TCPMon.OUTHOST_COLUMN);
bufferedData = bufferedData.substring(0, start)
+ url.toExternalForm()
+ bufferedData.substring(end);
@@ -363,7 +363,7 @@
+ " ";
s1 = s1.substring(0, 51);
listener.tableModel.setValueAt(s1, index + 1,
- HTTPTracer.REQ_COLUMN);
+ TCPMon.REQ_COLUMN);
}
}
if (targetPort == -1) {
@@ -396,7 +396,7 @@
while ((rr1 != null) || (rr2 != null)) {
if (rr2 != null) {
- listener.tableModel.setValueAt(rr2.getElapsed(), 1 + index, HTTPTracer.ELAPSED_COLUMN);
+ listener.tableModel.setValueAt(rr2.getElapsed(), 1 + index, TCPMon.ELAPSED_COLUMN);
}
// Only loop as long as the connection to the target
@@ -407,8 +407,8 @@
if ((null != rr1) && rr1.isDone()) {
if ((index >= 0) && (rr2 != null)) {
listener.tableModel.setValueAt(
- HTTPTracer.getMessage("resp00", "Resp"), 1 + index,
- HTTPTracer.STATE_COLUMN);
+ TCPMon.getMessage("resp00", "Resp"), 1 + index,
+ TCPMon.STATE_COLUMN);
}
rr1 = null;
}
@@ -416,8 +416,8 @@
if ((null != rr2) && rr2.isDone()) {
if ((index >= 0) && (rr1 != null)) {
listener.tableModel.setValueAt(
- HTTPTracer.getMessage("req00", "Req"), 1 + index,
- HTTPTracer.STATE_COLUMN);
+ TCPMon.getMessage("req00", "Req"), 1 + index,
+ TCPMon.STATE_COLUMN);
}
rr2 = null;
}
@@ -431,8 +431,8 @@
if (index >= 0) {
listener.tableModel.setValueAt(
- HTTPTracer.getMessage("done00", "Done"),
- 1 + index, HTTPTracer.STATE_COLUMN);
+ TCPMon.getMessage("done00", "Done"),
+ 1 + index, TCPMon.STATE_COLUMN);
}
} catch (Exception e) {
@@ -441,8 +441,8 @@
int index = listener.connections.indexOf(this);
if (index >= 0) {
listener.tableModel.setValueAt(
- HTTPTracer.getMessage("error00", "Error"), 1 + index,
- HTTPTracer.STATE_COLUMN);
+ TCPMon.getMessage("error00", "Error"), 1 + index,
+ TCPMon.STATE_COLUMN);
}
e.printStackTrace(wr);
wr.close();
Modified: webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Listener.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Listener.java?rev=388914&r1=388902&r2=388914&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Listener.java (original)
+++ webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Listener.java Sun Mar 26 07:21:54 2006
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.apache.ws.commons.tracer;
+package org.apache.ws.commons.tcpmon;
import javax.swing.BorderFactory;
import javax.swing.Box;
@@ -212,7 +212,7 @@
SlowLinkSimulator slowLink) {
notebook = _notebook;
if (name == null) {
- name = HTTPTracer.getMessage("port01", "Port") + " " + listenPort;
+ name = TCPMon.getMessage("port01", "Port") + " " + listenPort;
}
// set the slow link to the passed down link
@@ -230,21 +230,21 @@
JPanel top = new JPanel();
top.setLayout(new BoxLayout(top, BoxLayout.X_AXIS));
top.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
- final String start = HTTPTracer.getMessage("start00", "Start");
+ final String start = TCPMon.getMessage("start00", "Start");
top.add(stopButton = new JButton(start));
top.add(Box.createRigidArea(new Dimension(5, 0)));
top.add(new JLabel(" "
- + HTTPTracer.getMessage("listenPort01", "Listen Port:")
+ + TCPMon.getMessage("listenPort01", "Listen Port:")
+ " ", SwingConstants.RIGHT));
top.add(portField = new JTextField("" + listenPort, 4));
- top.add(new JLabel(" " + HTTPTracer.getMessage("host00", "Host:"),
+ top.add(new JLabel(" " + TCPMon.getMessage("host00", "Host:"),
SwingConstants.RIGHT));
top.add(hostField = new JTextField(host, 30));
- top.add(new JLabel(" " + HTTPTracer.getMessage("port02", "Port:") + " ",
+ top.add(new JLabel(" " + TCPMon.getMessage("port02", "Port:") + " ",
SwingConstants.RIGHT));
top.add(tPortField = new JTextField("" + targetPort, 4));
top.add(Box.createRigidArea(new Dimension(5, 0)));
- top.add(isProxyBox = new JCheckBox(HTTPTracer.getMessage("proxy00", "Proxy")));
+ top.add(isProxyBox = new JCheckBox(TCPMon.getMessage("proxy00", "Proxy")));
isProxyBox.addChangeListener(new BasicButtonListener(isProxyBox) {
public void stateChanged(ChangeEvent event) {
JCheckBox box = (JCheckBox) event.getSource();
@@ -262,7 +262,7 @@
tPortField.setMaximumSize(new Dimension(50, Short.MAX_VALUE));
stopButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
- if (HTTPTracer.getMessage("stop00",
+ if (TCPMon.getMessage("stop00",
"Stop").equals(event.getActionCommand())) {
stop();
}
@@ -277,14 +277,14 @@
// and the request/response text areas on the bottom
// ///////////////////////////////////////////////////////////////////
tableModel = new DefaultTableModel(new String[]{
- HTTPTracer.getMessage("state00", "State"),
- HTTPTracer.getMessage("time00", "Time"),
- HTTPTracer.getMessage("requestHost00", "Request Host"),
- HTTPTracer.getMessage("targetHost", "Target Host"),
- HTTPTracer.getMessage("request00", "Request..."),
- HTTPTracer.getMessage("elapsed00", "Elapsed Time")}, 0);
+ TCPMon.getMessage("state00", "State"),
+ TCPMon.getMessage("time00", "Time"),
+ TCPMon.getMessage("requestHost00", "Request Host"),
+ TCPMon.getMessage("targetHost", "Target Host"),
+ TCPMon.getMessage("request00", "Request..."),
+ TCPMon.getMessage("elapsed00", "Elapsed Time")}, 0);
tableModel.addRow(new Object[]{"---",
- HTTPTracer.getMessage("mostRecent00",
+ TCPMon.getMessage("mostRecent00",
"Most Recent"),
"---", "---", "---", "---"});
connectionTable = new JTable(1, 2);
@@ -294,9 +294,9 @@
// Reduce the STATE column and increase the REQ column
TableColumn col;
- col = connectionTable.getColumnModel().getColumn(HTTPTracer.STATE_COLUMN);
+ col = connectionTable.getColumnModel().getColumn(TCPMon.STATE_COLUMN);
col.setMaxWidth(col.getPreferredWidth() / 2);
- col = connectionTable.getColumnModel().getColumn(HTTPTracer.REQ_COLUMN);
+ col = connectionTable.getColumnModel().getColumn(TCPMon.REQ_COLUMN);
col.setPreferredWidth(col.getPreferredWidth() * 2);
ListSelectionModel sel = connectionTable.getSelectionModel();
sel.addListSelectionListener(new ListSelectionListener() {
@@ -312,7 +312,7 @@
new JLabel(
" "
+
- HTTPTracer.getMessage("wait00",
+ TCPMon.getMessage("wait00",
"Waiting for Connection...")));
setRight(new JLabel(""));
removeButton.setEnabled(false);
@@ -327,7 +327,7 @@
new JLabel(
" "
+
- HTTPTracer.getMessage("wait00",
+ TCPMon.getMessage("wait00",
"Waiting for connection...")));
setRight(new JLabel(""));
removeButton.setEnabled(false);
@@ -365,11 +365,11 @@
JPanel buttons = new JPanel();
buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
buttons.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
- final String removeSelected = HTTPTracer.getMessage("removeSelected00",
+ final String removeSelected = TCPMon.getMessage("removeSelected00",
"Remove Selected");
buttons.add(removeButton = new JButton(removeSelected));
buttons.add(Box.createRigidArea(new Dimension(5, 0)));
- final String removeAll = HTTPTracer.getMessage("removeAll00", "Remove All");
+ final String removeAll = TCPMon.getMessage("removeAll00", "Remove All");
buttons.add(removeAllButton = new JButton(removeAll));
tablePane.add(buttons, BorderLayout.SOUTH);
removeButton.setEnabled(false);
@@ -397,14 +397,14 @@
leftPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS));
leftPanel.add(new JLabel(" "
- + HTTPTracer.getMessage("request01", "Request")));
+ + TCPMon.getMessage("request01", "Request")));
leftPanel.add(new JLabel(" "
- + HTTPTracer.getMessage("wait01",
+ + TCPMon.getMessage("wait01",
"Waiting for connection")));
rightPanel = new JPanel();
rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.Y_AXIS));
rightPanel.add(new JLabel(" "
- + HTTPTracer.getMessage("response00", "Response")));
+ + TCPMon.getMessage("response00", "Response")));
rightPanel.add(new JLabel(""));
outPane = new JSplitPane(0, leftPanel, rightPanel);
outPane.setDividerSize(4);
@@ -416,18 +416,18 @@
5));
bottomButtons.add(
xmlFormatBox =
- new JCheckBox(HTTPTracer.getMessage("xmlFormat00", "XML Format")));
+ new JCheckBox(TCPMon.getMessage("xmlFormat00", "XML Format")));
bottomButtons.add(Box.createRigidArea(new Dimension(5, 0)));
- final String save = HTTPTracer.getMessage("save00", "Save");
+ final String save = TCPMon.getMessage("save00", "Save");
bottomButtons.add(saveButton = new JButton(save));
bottomButtons.add(Box.createRigidArea(new Dimension(5, 0)));
- final String resend = HTTPTracer.getMessage("resend00", "Resend");
+ final String resend = TCPMon.getMessage("resend00", "Resend");
bottomButtons.add(resendButton = new JButton(resend));
bottomButtons.add(Box.createRigidArea(new Dimension(5, 0)));
- final String switchStr = HTTPTracer.getMessage("switch00", "Switch Layout");
+ final String switchStr = TCPMon.getMessage("switch00", "Switch Layout");
bottomButtons.add(switchButton = new JButton(switchStr));
bottomButtons.add(Box.createHorizontalGlue());
- final String close = HTTPTracer.getMessage("close00", "Close");
+ final String close = TCPMon.getMessage("close00", "Close");
bottomButtons.add(closeButton = new JButton(close));
pane2.add(bottomButtons, BorderLayout.SOUTH);
saveButton.setEnabled(false);
@@ -512,11 +512,11 @@
int port = Integer.parseInt(portField.getText());
portField.setText("" + port);
int i = notebook.indexOfComponent(this);
- notebook.setTitleAt(i, HTTPTracer.getMessage("port01", "Port") + " " + port);
+ notebook.setTitleAt(i, TCPMon.getMessage("port01", "Port") + " " + port);
int tmp = Integer.parseInt(tPortField.getText());
tPortField.setText("" + tmp);
sw = new SocketWaiter(this, port);
- stopButton.setText(HTTPTracer.getMessage("stop00", "Stop"));
+ stopButton.setText(TCPMon.getMessage("stop00", "Stop"));
portField.setEditable(false);
hostField.setEditable(false);
tPortField.setEditable(false);
@@ -541,7 +541,7 @@
conn.halt();
}
sw.halt();
- stopButton.setText(HTTPTracer.getMessage("start00", "Start"));
+ stopButton.setText(TCPMon.getMessage("start00", "Start"));
portField.setEditable(true);
hostField.setEditable(true);
tPortField.setEditable(true);
@@ -601,23 +601,23 @@
&& (lsm.getLeadSelectionIndex() == 0))) {
rc = Integer.parseInt(portField.getText());
out.write("\n==============\n".getBytes());
- out.write(((HTTPTracer.getMessage("listenPort01",
+ out.write(((TCPMon.getMessage("listenPort01",
"Listen Port:")
+ " " + rc + "\n")).getBytes());
- out.write((HTTPTracer.getMessage("targetHost01",
+ out.write((TCPMon.getMessage("targetHost01",
"Target Host:")
+ " " + hostField.getText()
+ "\n").getBytes());
rc = Integer.parseInt(tPortField.getText());
- out.write(((HTTPTracer.getMessage("targetPort01",
+ out.write(((TCPMon.getMessage("targetPort01",
"Target Port:")
+ " " + rc + "\n")).getBytes());
out.write((("==== "
- + HTTPTracer.getMessage("request01", "Request")
+ + TCPMon.getMessage("request01", "Request")
+ " ====\n")).getBytes());
out.write(conn.inputText.getText().getBytes());
out.write((("==== "
- + HTTPTracer.getMessage("response00", "Response")
+ + TCPMon.getMessage("response00", "Response")
+ " ====\n")).getBytes());
out.write(conn.outputText.getText().getBytes());
out.write("\n==============\n".getBytes());
Modified: webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Relay.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Relay.java?rev=388914&r1=388902&r2=388914&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Relay.java (original)
+++ webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Relay.java Sun Mar 26 07:21:54 2006
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.ws.commons.tracer;
+package org.apache.ws.commons.tcpmon;
import java.io.IOException;
import java.io.InputStream;
Modified: webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Sender.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Sender.java?rev=388914&r1=388902&r2=388914&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Sender.java (original)
+++ webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/Sender.java Sun Mar 26 07:21:54 2006
@@ -1,4 +1,4 @@
-package org.apache.ws.commons.tracer;
+package org.apache.ws.commons.tcpmon;
import javax.swing.BorderFactory;
import javax.swing.Box;
@@ -97,14 +97,14 @@
bottomButtons.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
bottomButtons.add(
xmlFormatBox =
- new JCheckBox(HTTPTracer.getMessage("xmlFormat00", "XML Format")));
+ new JCheckBox(TCPMon.getMessage("xmlFormat00", "XML Format")));
bottomButtons.add(Box.createRigidArea(new Dimension(5, 0)));
bottomButtons.add(sendButton = new JButton("Send"));
bottomButtons.add(Box.createRigidArea(new Dimension(5, 0)));
- final String switchStr = HTTPTracer.getMessage("switch00", "Switch Layout");
+ final String switchStr = TCPMon.getMessage("switch00", "Switch Layout");
bottomButtons.add(switchButton = new JButton(switchStr));
bottomButtons.add(Box.createHorizontalGlue());
- final String close = HTTPTracer.getMessage("close00", "Close");
+ final String close = TCPMon.getMessage("close00", "Close");
pane2.add(bottomButtons, BorderLayout.SOUTH);
sendButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
Modified: webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/SlowLinkSimulator.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/SlowLinkSimulator.java?rev=388914&r1=388902&r2=388914&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/SlowLinkSimulator.java (original)
+++ webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/SlowLinkSimulator.java Sun Mar 26 07:21:54 2006
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.apache.ws.commons.tracer;
+package org.apache.ws.commons.tcpmon;
/**
* class to simulate slow connections by slowing down the system
Modified: webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/SocketRR.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/SocketRR.java?rev=388914&r1=388902&r2=388914&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/SocketRR.java (original)
+++ webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/SocketRR.java Sun Mar 26 07:21:54 2006
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.apache.ws.commons.tracer;
+package org.apache.ws.commons.tcpmon;
import javax.swing.JTextArea;
import javax.swing.table.TableModel;
@@ -157,7 +157,7 @@
int thisIndent = -1, nextIndent = -1, previousIndent = -1;
if (tmodel != null) {
String tmpStr = (String) tmodel.getValueAt(tableIndex,
- HTTPTracer.REQ_COLUMN);
+ TCPMon.REQ_COLUMN);
if (!"".equals(tmpStr)) {
reqSaved = tmpStr.length();
}
@@ -215,7 +215,7 @@
if ((tmodel != null) && (reqSaved < 50)) {
String old = (String) tmodel.getValueAt(tableIndex,
- HTTPTracer.REQ_COLUMN);
+ TCPMon.REQ_COLUMN);
old = old + new String(buffer, saved, len);
if (old.length() > 50) {
old = old.substring(0, 50);
@@ -225,7 +225,7 @@
old = old.substring(0, i - 1);
reqSaved = 50;
}
- tmodel.setValueAt(old, tableIndex, HTTPTracer.REQ_COLUMN);
+ tmodel.setValueAt(old, tableIndex, TCPMon.REQ_COLUMN);
}
Modified: webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/SocketWaiter.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/SocketWaiter.java?rev=388914&r1=388902&r2=388914&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/SocketWaiter.java (original)
+++ webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/SocketWaiter.java Sun Mar 26 07:21:54 2006
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.apache.ws.commons.tracer;
+package org.apache.ws.commons.tcpmon;
import javax.swing.JLabel;
import java.awt.Color;
@@ -66,7 +66,7 @@
try {
listener.setLeft(
new JLabel(
- HTTPTracer.getMessage("wait00",
+ TCPMon.getMessage("wait00",
" Waiting for Connection...")));
listener.repaint();
sSocket = new ServerSocket(port);
Added: webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/TCPMon.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/TCPMon.java?rev=388914&view=auto
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/TCPMon.java (added)
+++ webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/TCPMon.java Sun Mar 26 07:21:54 2006
@@ -0,0 +1,214 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.commons.tcpmon;
+
+import javax.swing.JFrame;
+import javax.swing.JTabbedPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import java.util.ResourceBundle;
+
+/**
+ * Proxy that sniffs and shows HTTP messages and responses, both SOAP and plain HTTP.
+ */
+
+public class TCPMon extends JFrame {
+
+ /**
+ * Field notebook
+ */
+ private JTabbedPane notebook = null;
+
+ /**
+ * Field STATE_COLUMN
+ */
+ static final int STATE_COLUMN = 0;
+
+ /**
+ * Field OUTHOST_COLUMN
+ */
+ static final int OUTHOST_COLUMN = 3;
+
+ /**
+ * Field REQ_COLUMN
+ */
+ static final int REQ_COLUMN = 4;
+
+ /**
+ * Field ELAPSED_COLUMN
+ */
+ static final int ELAPSED_COLUMN = 5;
+
+ /**
+ * Field DEFAULT_HOST
+ */
+ static final String DEFAULT_HOST = "127.0.0.1";
+
+ /**
+ * Field DEFAULT_PORT
+ */
+ static final int DEFAULT_PORT = 8888;
+
+ /**
+ * Constructor
+ *
+ * @param listenPort
+ * @param targetHost
+ * @param targetPort
+ * @param embedded
+ */
+ public TCPMon(int listenPort, String targetHost, int targetPort, boolean embedded) {
+ super(getMessage("httptracer00","TCPMon"));
+ notebook = new JTabbedPane();
+ this.getContentPane().add(notebook);
+ new AdminPane(notebook, getMessage("admin00", "Admin"));
+ if (listenPort != 0) {
+ Listener l = null;
+ if (targetHost == null) {
+ l = new Listener(notebook, null, listenPort, targetHost, targetPort, true, null);
+ } else {
+ l = new Listener(notebook, null, listenPort, targetHost, targetPort, false, null);
+ }
+ notebook.setSelectedIndex(1);
+ l.HTTPProxyHost = System.getProperty("http.proxyHost");
+ if ((l.HTTPProxyHost != null) && l.HTTPProxyHost.equals("")) {
+ l.HTTPProxyHost = null;
+ }
+ if (l.HTTPProxyHost != null) {
+ String tmp = System.getProperty("http.proxyPort");
+ if ((tmp != null) && tmp.equals("")) {
+ tmp = null;
+ }
+ if (tmp == null) {
+ l.HTTPProxyPort = 80;
+ } else {
+ l.HTTPProxyPort = Integer.parseInt(tmp);
+ }
+ }
+ }
+ if (!embedded) {
+ this.setDefaultCloseOperation(EXIT_ON_CLOSE);
+ }
+ this.pack();
+ this.setSize(1000, 700);
+ this.setVisible(true);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param listenPort
+ * @param targetHost
+ * @param targetPort
+ */
+ public TCPMon(int listenPort, String targetHost, int targetPort) {
+ this(listenPort, targetHost, targetPort, false);
+ }
+
+ /**
+ * set up the L&F
+ *
+ * @param nativeLookAndFeel
+ * @throws Exception
+ */
+ private static void setupLookAndFeel(boolean nativeLookAndFeel) throws Exception {
+ String classname = UIManager.getCrossPlatformLookAndFeelClassName();
+ if (nativeLookAndFeel) {
+ classname = UIManager.getSystemLookAndFeelClassName();
+ }
+ String lafProperty = System.getProperty("httptracer.laf", "");
+ if (lafProperty.length() > 0) {
+ classname = lafProperty;
+ }
+ try {
+ UIManager.setLookAndFeel(classname);
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (UnsupportedLookAndFeelException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * this is our main method
+ *
+ * @param args
+ */
+ public static void main(String[] args) {
+ try {
+
+ // switch between swing L&F here
+ setupLookAndFeel(true);
+ if (args.length == 3) {
+ int p1 = Integer.parseInt(args[0]);
+ int p2 = Integer.parseInt(args[2]);
+ new TCPMon(p1, args[1], p2);
+ } else if (args.length == 1) {
+ int p1 = Integer.parseInt(args[0]);
+ new TCPMon(p1, null, 0);
+ } else if (args.length != 0) {
+ System.err.println(
+ getMessage("usage00", "Usage:")
+ + " TCPMon [listenPort targetHost targetPort]\n");
+ } else {
+ new TCPMon(0, null, 0);
+ }
+ } catch (Throwable exp) {
+ exp.printStackTrace();
+ }
+ }
+
+ /**
+ * Field messages
+ */
+ private static ResourceBundle messages = null;
+
+ /**
+ * Get the message with the given key. There are no arguments for this message.
+ *
+ * @param key
+ * @param defaultMsg
+ * @return string
+ */
+ public static String getMessage(String key, String defaultMsg) {
+ try {
+ if (messages == null) {
+ initializeMessages();
+ }
+ return messages.getString(key);
+ } catch (Throwable t) {
+
+ // If there is any problem whatsoever getting the internationalized
+ // message, return the default.
+ return defaultMsg;
+ }
+ }
+
+ /**
+ * Load the resource bundle messages from the properties file. This is ONLY done when it is
+ * needed. If no messages are printed (for example, only Wsdl2java is being run in non-
+ * verbose mode) then there is no need to read the properties file.
+ */
+ private static void initializeMessages() {
+ messages = ResourceBundle.getBundle("org.apache.ws.commons.tcpmon.tcpmon");
+ }
+
+}
Modified: webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/TcpTunnel.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/TcpTunnel.java?rev=388914&r1=388902&r2=388914&view=diff
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/TcpTunnel.java (original)
+++ webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/TcpTunnel.java Sun Mar 26 07:21:54 2006
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.ws.commons.tracer;
+package org.apache.ws.commons.tcpmon;
import java.io.IOException;
import java.net.ServerSocket;
Added: webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/tcpmon.properties
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/tcpmon.properties?rev=388914&view=auto
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/tcpmon.properties (added)
+++ webservices/commons/trunk/modules/tcpmon/src/org/apache/ws/commons/tcpmon/tcpmon.properties Sun Mar 26 07:21:54 2006
@@ -0,0 +1,59 @@
+# Translation instructions.
+# 1. Each message line is of the form key=value. Translate the value, DO NOT translate the key.
+# 2. The messages may contain arguments that will be filled in by the runtime. These are of the form: {0}, {1}, etc. These must appear as is in the message, though the order may be changed to support proper language syntax.
+# 3. If a single quote character is to appear in the resulting message, it must appear in this file as two consecutive single quote characters.
+# 4. Lines beginning with "#" (like this one) are comment lines and may contain translation instructions. They need not be translated unless your translated file, rather than this file, will serve as a base for other translators.
+
+actAs00=Act as a...
+active00=Active
+add00=Add
+admin00=Admin
+close00=Close
+done00=Done
+resp00=Resp
+req00=Req
+error00=Error
+host00=Host:
+hostname00=Hostname
+listener00=Listener
+listenPort00=Listen Port #
+listenPort01=Listen Port:
+mostRecent00=Most Recent
+newTCP00=Create a new TCPMon...
+options00=Options
+port00=Port #
+port01=Port
+port02=Port:
+proxy00=Proxy
+proxySupport00=HTTP Proxy Support
+removeAll00=Remove All
+removeSelected00=Remove Selected
+request00=Request...
+request01=Request
+requestHost00=Request Host
+resend00=Resend
+response00=Response
+save00=Save
+start00=Start
+state00=State
+stop00=Stop
+switch00=Switch Layout
+targetHost00=Target Host
+targetHost01=Target Host:
+targetHostname00=Target Hostname
+targetPort00=Target Port #
+targetPort01=Target Port:
+time00=Time
+usage00=Usage:
+wait00=Waiting for Connection...
+wait01=Waiting for Connection
+
+# NOTE: in xmlFormat00, do not translate "XML"
+xmlFormat00=XML Format
+
+#NOTE: this is a SimpleDateFormat format string to declare the layout of date
+#and time in the message log. It does need i18n, but not 'translation', per se.
+dateformat00=yyyy-MM-dd HH:mm:ss
+delay00=Simulate Slow Connection
+delay01=Bytes per Pause
+delay02=Delay in Milliseconds
\ No newline at end of file
Added: webservices/commons/trunk/modules/tcpmon/xdocs/images/Thumbs.db
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/xdocs/images/Thumbs.db?rev=388914&view=auto
==============================================================================
Binary file - no diff available.
Propchange: webservices/commons/trunk/modules/tcpmon/xdocs/images/Thumbs.db
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: webservices/commons/trunk/modules/tcpmon/xdocs/images/concept.jpg
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/xdocs/images/concept.jpg?rev=388914&view=auto
==============================================================================
Binary file - no diff available.
Propchange: webservices/commons/trunk/modules/tcpmon/xdocs/images/concept.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen1.jpg
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/xdocs/images/screen1.jpg?rev=388914&view=auto
==============================================================================
Binary file - no diff available.
Propchange: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen1.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2-browser.jpg
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2-browser.jpg?rev=388914&view=auto
==============================================================================
Binary file - no diff available.
Propchange: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2-browser.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2-closeup1.jpg
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2-closeup1.jpg?rev=388914&view=auto
==============================================================================
Binary file - no diff available.
Propchange: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2-closeup1.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2-closeup2.jpg
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2-closeup2.jpg?rev=388914&view=auto
==============================================================================
Binary file - no diff available.
Propchange: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2-closeup2.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2.jpg
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2.jpg?rev=388914&view=auto
==============================================================================
Binary file - no diff available.
Propchange: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen2.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen3.jpg
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/xdocs/images/screen3.jpg?rev=388914&view=auto
==============================================================================
Binary file - no diff available.
Propchange: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen3.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen4.jpg
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/xdocs/images/screen4.jpg?rev=388914&view=auto
==============================================================================
Binary file - no diff available.
Propchange: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen4.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen5.jpg
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/xdocs/images/screen5.jpg?rev=388914&view=auto
==============================================================================
Binary file - no diff available.
Propchange: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen5.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen6.jpg
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/xdocs/images/screen6.jpg?rev=388914&view=auto
==============================================================================
Binary file - no diff available.
Propchange: webservices/commons/trunk/modules/tcpmon/xdocs/images/screen6.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: webservices/commons/trunk/modules/tcpmon/xdocs/navigation.xml
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/xdocs/navigation.xml?rev=388914&view=auto
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/xdocs/navigation.xml (added)
+++ webservices/commons/trunk/modules/tcpmon/xdocs/navigation.xml Sun Mar 26 07:21:54 2006
@@ -0,0 +1,21 @@
+<project name="TCPMon">
+ <title>Web Services Commons : TCPMon Implemenation</title>
+ <body>
+ <menu name="TCPMon">
+ <item name="Home" href="index.html"/>
+ <item nane="Downloads">
+ <item name="Releases" href="download.cgi"/>
+ <item name="Source Code" href="http://svn.apache.org/repos/asf/webservices/commons/modules/axiom"/>
+ </item>
+ <item name="Documentation">
+ <item name="TCPMon Tutorial" href="tcpmontutorial.html"/>
+ <item name="Javadocs" href="/apidocs/index.html"/>
+ </item>
+ <item name="Project Information">
+ <item name="Mailing Lists" href="/mail-lists.html"/>
+ <item name="Project Team" href="/team-list.html"/>
+ </item>
+ </menu>
+ </body>
+
+</project>
Added: webservices/commons/trunk/modules/tcpmon/xdocs/tcpmontutorial.html
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/tcpmon/xdocs/tcpmontutorial.html?rev=388914&view=auto
==============================================================================
--- webservices/commons/trunk/modules/tcpmon/xdocs/tcpmontutorial.html (added)
+++ webservices/commons/trunk/modules/tcpmon/xdocs/tcpmontutorial.html Sun Mar 26 07:21:54 2006
@@ -0,0 +1,114 @@
+<html>
+<head>
+ <meta http-equiv="content-type" content="">
+ <title>TCPMon Tutorial</title>
+</head>
+
+<body>
+<header></header>
+<h1>TCPMon Tutorial</h1>
+
+<h2>Introduction</h2>
+
+<p>TCPMon is a utility that allows the user to monitor the messages passed
+along in TCP based conversation. It is based on a swing ui and works on
+almost all paltforms that Java supports. The aim of this simple tutorial is
+to explain how TCPMon works and also to explain some of its features.</p>
+
+<h2>Structure and Dependancies</h2>
+
+<p>TCPMon has absolutely no dependancies on third party libraries. But some
+of the UI features rely on JDK 1.4 so TCPMon needs a JRE that is 1.4 or
+higher.</p>
+
+<h2>Usage Patterns</h2>
+
+<h3>As an Explicit Intermediate</h3>
+
+<p>The most common usage pattern for the TCPMon is as an intermediary. It is
+called explicit since the client has to point to the intermediary rather than
+the original endpoint in order to monitor the messages. The following figure
+explains the concept of this.</p>
+
+<p><img alt="concept" src="images/concept.jpg"></p>
+
+<p></p>
+
+<p>In order to start the TCPMon in this configuration one has to provide the
+host name and the port for the listener in the admin screen.</p>
+
+<p><img alt="first screen" src="images/screen1.jpg"></p>
+
+<p>pressing the add button opens up a new tab that allows the messages to be
+seen as in the following screen</p>
+
+<p><img alt="message screen" src="images/screen2.jpg"></p>
+
+<p>At this point the requester should point to the listen port of the TCPMon
+instead of the original endpoint. Let us understand this with an example.</p>
+
+<p>Say all messages passed between www.apache.org needs to be monitored.</p>
+
+<p><strong>step 1</strong> - Add a listener with host as www.apache.org and
+port as 80. set the listener to port 8080 which may be any unused port in the
+local machine</p>
+
+<p><img alt="the settings" src="images/screen2-closeup2.jpg"></p>
+
+<p><strong>step 2</strong> - point the browser to localhost:8080 instead of
+www.apache.org.</p>
+
+<p><img alt="browser address bar" src="images/screen2-browser.jpg"></p>
+
+<p>Once the messages start flowing they can be seen in the relevant tab.</p>
+
+<p><img alt="Filles screen" src="images/screen3.jpg"></p>
+
+<p>The bottom controls allow the messages to be XML formatted (useful in
+debugging web services), save and resend the messages and also to switch the
+layout of the message windows.</p>
+
+<p><img alt="button set" src="images/screen2-closeup1.jpg"></p>
+
+<h3>As a Request Sender for Web Services </h3>
+
+<p>TCPMon can also be used as a request sender for web services. The request
+SOAP message can be pasted on the send screen and then sent directly to the
+server </p>
+
+<p><img alt="request sender" src="images/screen4.jpg"></p>
+
+<p></p>
+
+<h3>As a Proxy</h3>
+
+<p>TCPMon can act as a proxy. To start the TCPMon at proxy mode, just select
+the proxy option from the radio buttons.</p>
+
+<p><img alt="proxy" src="images/screen5.jpg"></p>
+
+<p>when acting as a proxy, TCPMon only needs the listener port to be
+configured.</p>
+
+<h2>Advanced Settings</h2>
+
+<h3>Slow Connection Simulation</h3>
+
+<p>TCPMon can simulate a slow connection, in which case the delay and the
+bytes to be dropped can be configured. This is specially useful in testing
+web services.</p>
+
+<p><img alt="slow-connection" src="images/screen6.jpg"></p>
+
+<h3>HTTP Proxy support</h3>
+
+<p>If HTTP proxy support is required then that can also be set in the admin
+screen</p>
+
+<h2>Conclusion</h2>
+
+<p>TCPMon is a simple and easy to use tool that has many benifits when
+developing message driven applications. It is particulary useful in
+developing web services</p>
+</body>
+</html>