You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@etch.apache.org by sc...@apache.org on 2008/11/20 18:02:42 UTC

svn commit: r719286 - in /incubator/etch/trunk: binding-java/runtime/src/main/java/etch/bindings/java/transport/ util/src/main/java/etch/util/core/io/ util/src/test/java/etch/util/core/io/

Author: sccomer
Date: Thu Nov 20 09:02:42 2008
New Revision: 719286

URL: http://svn.apache.org/viewvc?rev=719286&view=rev
Log:
fix for etch-17: SessionListener needs to be more independent.
fix for etch-19: Break out common tcp transport options so that they may be shared among various transports.

Added:
    incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpOptions.java   (with props)
Modified:
    incubator/etch/trunk/binding-java/runtime/src/main/java/etch/bindings/java/transport/TcpTransportFactory.java
    incubator/etch/trunk/util/src/main/java/etch/util/core/io/Connection.java
    incubator/etch/trunk/util/src/main/java/etch/util/core/io/SessionListener.java
    incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpListener.java
    incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpTransport.java
    incubator/etch/trunk/util/src/main/java/etch/util/core/io/TlsListener.java
    incubator/etch/trunk/util/src/test/java/etch/util/core/io/TestListener.java
    incubator/etch/trunk/util/src/test/java/etch/util/core/io/TestTcpConnection.java

Modified: incubator/etch/trunk/binding-java/runtime/src/main/java/etch/bindings/java/transport/TcpTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-java/runtime/src/main/java/etch/bindings/java/transport/TcpTransportFactory.java?rev=719286&r1=719285&r2=719286&view=diff
==============================================================================
--- incubator/etch/trunk/binding-java/runtime/src/main/java/etch/bindings/java/transport/TcpTransportFactory.java (original)
+++ incubator/etch/trunk/binding-java/runtime/src/main/java/etch/bindings/java/transport/TcpTransportFactory.java Thu Nov 20 09:02:42 2008
@@ -95,7 +95,6 @@
 		return d;
 	}
 
-	@SuppressWarnings("unchecked")
 	@Override
 	public Transport<ServerFactory> newListener( final String uri,
 		final Resources resources, final ServerFactory factory )
@@ -103,7 +102,7 @@
 	{
 		URL u = new URL( uri );
 		
-		Transport<SessionListener> l;
+		Transport<SessionListener<Socket>> l;
 
 		if (isSecure)
 			l = new TlsListener( u, resources );
@@ -115,14 +114,14 @@
 		return b;
 	}
 	
-	private class MySessionListener implements Transport<ServerFactory>, SessionListener
+	private class MySessionListener implements Transport<ServerFactory>, SessionListener<Socket>
 	{
 		/**
 		 * @param transport
 		 * @param uri
 		 * @param resources
 		 */
-		public MySessionListener( Transport<SessionListener> transport, String uri, Resources resources )
+		public MySessionListener( Transport<SessionListener<Socket>> transport, String uri, Resources resources )
 		{
 			this.transport = transport;
 			this.uri = uri;
@@ -131,7 +130,7 @@
 			transport.setSession( this );
 		}
 		
-		private final Transport<SessionListener> transport;
+		private final Transport<SessionListener<Socket>> transport;
 		
 		private final String uri;
 		

Modified: incubator/etch/trunk/util/src/main/java/etch/util/core/io/Connection.java
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/util/src/main/java/etch/util/core/io/Connection.java?rev=719286&r1=719285&r2=719286&view=diff
==============================================================================
--- incubator/etch/trunk/util/src/main/java/etch/util/core/io/Connection.java (original)
+++ incubator/etch/trunk/util/src/main/java/etch/util/core/io/Connection.java Thu Nov 20 09:02:42 2008
@@ -31,7 +31,6 @@
  * Implementation of runner which handles a network connection.
  * @param <H> the event handler type.
  */
-@SuppressWarnings("unchecked")
 abstract public class Connection<H extends Session>
 	extends Runner implements Transport<H>, RunnerHandler
 {

Modified: incubator/etch/trunk/util/src/main/java/etch/util/core/io/SessionListener.java
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/util/src/main/java/etch/util/core/io/SessionListener.java?rev=719286&r1=719285&r2=719286&view=diff
==============================================================================
--- incubator/etch/trunk/util/src/main/java/etch/util/core/io/SessionListener.java (original)
+++ incubator/etch/trunk/util/src/main/java/etch/util/core/io/SessionListener.java Thu Nov 20 09:02:42 2008
@@ -17,17 +17,16 @@
 
 package etch.util.core.io;
 
-import java.net.Socket;
-
 /**
  * Interface used to deliver sockets to the session from the listener.
+ * @param <T> the type of the connection for the session.
  */
-public interface SessionListener extends Session
+public interface SessionListener<T> extends Session
 {
 	/**
 	 * Delivers a socket to the session from the listener.
-	 * @param socket
+	 * @param connection
 	 * @throws Exception
 	 */
-	public void sessionAccepted( Socket socket ) throws Exception;
+	public void sessionAccepted( T connection ) throws Exception;
 }

Modified: incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpListener.java
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpListener.java?rev=719286&r1=719285&r2=719286&view=diff
==============================================================================
--- incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpListener.java (original)
+++ incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpListener.java Thu Nov 20 09:02:42 2008
@@ -31,8 +31,8 @@
 /**
  * Implementation of a connection which handles a socket listener.
  */
-public class TcpListener extends Connection<SessionListener>
-	implements Transport<SessionListener>
+public class TcpListener extends Connection<SessionListener<Socket>>
+	implements Transport<SessionListener<Socket>>
 {
 	/**
 	 * Query term for URI to specify backlog value to ServerSocket. The value

Added: incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpOptions.java
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpOptions.java?rev=719286&view=auto
==============================================================================
--- incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpOptions.java (added)
+++ incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpOptions.java Thu Nov 20 09:02:42 2008
@@ -0,0 +1,184 @@
+/* $Id$
+ *
+ * Copyright 2007-2008 Cisco Systems Inc.
+ *
+ * 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 etch.util.core.io;
+
+import etch.util.Resources;
+import etch.util.URL;
+
+/**
+ * TCP connection options.
+ */
+public class TcpOptions
+{
+	/**
+	 * Constructs TcpOptions from uri and resources.
+	 * 
+	 * @param uri
+	 * @param resources
+	 */
+	public TcpOptions( URL uri, Resources resources )
+	{
+		autoFlush = uri.getBooleanTerm( AUTO_FLUSH, false );
+		bufferSize = checkBufferSize( uri.getIntegerTerm( BUFFER_SIZE, 0 ) );
+		keepAlive = uri.getBooleanTerm( KEEP_ALIVE, false );
+		lingerTime = checkLingerTime( uri.getIntegerTerm( LINGER_TIME, 30 ) );
+		noDelay = uri.getBooleanTerm( NO_DELAY, true );
+		reconnectDelay = checkReconnectDelay( uri.getIntegerTerm(
+			RECONNECT_DELAY, 0 ) );
+		trafficClass = checkTrafficClass( uri.getIntegerTerm( TRAFFIC_CLASS, 0 ) );
+	}
+
+	/**
+	 * Term on the uri which specifies the auto flush flag. The term string is
+	 * "TcpTransport.autoFlush". The value is "true" or "false". The default is
+	 * "false". Auto-flush only applies when the stream is buffered. True means
+	 * that any "sent" data is automatically pushed to the operating systems
+	 * without buffering.
+	 */
+	public final static String AUTO_FLUSH = "TcpTransport.autoFlush";
+
+	/**
+	 * Term on the uri which specifies the output buffer size in bytes. The term
+	 * string is "TcpTransport.bufferSize". The value is an integer between 0
+	 * and 65536. The default is 0, which means no output buffering.
+	 */
+	public final static String BUFFER_SIZE = "TcpTransport.bufferSize";
+
+	/**
+	 * Term on the uri which specifies the keep alive flag. The term string is
+	 * "TcpTransport.keepAlive". The value is "true" or "false". The default is
+	 * "false". Here keep alive refers to TCP specified keep alive, which is not
+	 * the same as any application level keep alive.
+	 */
+	public final static String KEEP_ALIVE = "TcpTransport.keepAlive";
+
+	/**
+	 * Term on the uri which specifies the linger on close time in seconds. The
+	 * term string is "TcpTransport.lingerTime". The value is an integer between
+	 * -1 and 65535. The default is 30. The value -1 means "no linger on close".
+	 * The value determines how long close will wait for buffered but
+	 * unacknowledged data to be delivered. When the time expires, the
+	 * connection will be forcefully closed. (The difference between a linger of
+	 * -1 and a linger of 0 is subtle, but comes down to a close with a linger
+	 * of -1 means perform forceful close while a close with a linger of 0 means
+	 * perform a graceful close if there is no buffered data and a forceful
+	 * close if there is buffered data. A forceful close is send RST, while a
+	 * graceful close means send FIN and wait for FINACK.)
+	 */
+	public final static String LINGER_TIME = "TcpTransport.lingerTime";
+
+	/**
+	 * Term on the uri which specifies the no delay flag. The term string is
+	 * "TcpTransport.noDelay". The value is "true" or "false". The default is
+	 * "true". When true, the operating system will make a best effort to
+	 * transmit data ASAP. When false, data might be delayed somewhat in order
+	 * to allow for more efficient transmission by combining packets (see
+	 * Nagle's Algorithm).
+	 */
+	public final static String NO_DELAY = "TcpTransport.noDelay";
+
+	/**
+	 * Term on the uri which specifies the reconnect delay in milliseconds. The
+	 * term string is "TcpTransport.reconnectDelay". The value is an integer >=
+	 * 0. The default is 0. The value 0 means no automatic reconnection is
+	 * desired.
+	 */
+	public final static String RECONNECT_DELAY = "TcpTransport.reconnectDelay";
+
+	/**
+	 * Term on the uri which specifies the traffic class. The term string is
+	 * "TcpTransport.trafficClass". The value is an integer between 0 and 255.
+	 * The default is 0. The value of this field is network and service specific
+	 * value. It is mapped to the IPv4 type of service (TOS) field and the IPv6
+	 * traffic class field. See also Differentiated Services (DSCP).
+	 */
+	public final static String TRAFFIC_CLASS = "TcpTransport.trafficClass";
+
+	/**
+	 * The auto flush setting for this connection. If true, each call to send
+	 * must automatically call flush.
+	 */
+	public final boolean autoFlush;
+
+	private static int checkBufferSize( int bufferSize )
+	{
+		if (bufferSize < 0 || bufferSize > 65536)
+			throw new IllegalArgumentException(
+				"bufferSize < 0 || bufferSize > 65536" );
+		return bufferSize;
+	}
+
+	/**
+	 * The output buffer size to use for this connection. The value is specified
+	 * as bytes, 0 means unbuffered output. If using buffered output, you'll
+	 * want to disable auto flush and call flush manually only when needed. Only
+	 * meaningful for stream protocols and implementations which use a stream
+	 * interface to the operating system.
+	 */
+	public final int bufferSize;
+
+	/** The tcp keep alive setting for this connection. */
+	public final boolean keepAlive;
+
+	private static int checkLingerTime( int lingerTime )
+	{
+		if (lingerTime < -1 || lingerTime > 240)
+			throw new IllegalArgumentException(
+				"lingerTime < -1 || lingerTime > 240" );
+		return lingerTime;
+	}
+
+	/**
+	 * The tcp linger time setting for this connection. Time in seconds, -1
+	 * means disable.
+	 */
+	public final int lingerTime;
+
+	/**
+	 * The tcp no delay setting for this connection. True disables nagle's
+	 * algorithm and causes all sends to be made asap.
+	 */
+	public final boolean noDelay;
+
+	private static int checkReconnectDelay( int reconnectDelay )
+	{
+		if (reconnectDelay < 0)
+			throw new IllegalArgumentException( "reconnectDelay < 0" );
+		return reconnectDelay;
+	}
+
+	/**
+	 * The reconnect delay for this connection. Time in milliseconds, 0 means do
+	 * not reconnect.
+	 */
+	public final int reconnectDelay;
+
+	private static int checkTrafficClass( int trafficClass )
+	{
+		if (trafficClass < 0 || trafficClass > 255)
+			throw new IllegalArgumentException(
+				"trafficClass < 0 || trafficClass > 255" );
+		return trafficClass;
+	}
+
+	/**
+	 * The traffic class for this connection. 0-255, 0 means normal handling.
+	 * Also called type of service or dscp.
+	 */
+	public final int trafficClass;
+}

Propchange: incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpOptions.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpOptions.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpTransport.java
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpTransport.java?rev=719286&r1=719285&r2=719286&view=diff
==============================================================================
--- incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpTransport.java (original)
+++ incubator/etch/trunk/util/src/main/java/etch/util/core/io/TcpTransport.java Thu Nov 20 09:02:42 2008
@@ -37,55 +37,6 @@
 	implements TransportData
 {
 	/**
-	 * Term on the uri which specifies the auto flush flag. The term string is
-	 * "TcpTransport.autoFlush". The value is "true" or "false". The default
-	 * is "false".
-	 */
-	public final static String AUTO_FLUSH = "TcpTransport.autoFlush";
-
-	/**
-	 * Term on the uri which specifies the buffer size in bytes. The term
-	 * string is "TcpTransport.bufferSize". The value is an integer between
-	 * 0 and 65536. The default is 0.
-	 */
-	public final static String BUFFER_SIZE = "TcpTransport.bufferSize";
-
-	/**
-	 * Term on the uri which specifies the keep alive flag. The term string is
-	 * "TcpTransport.keepAlive". The value is "true" or "false". The default is
-	 * "false".
-	 */
-	public final static String KEEP_ALIVE = "TcpTransport.keepAlive";
-
-	/**
-	 * Term on the uri which specifies the linger time in seconds. The term
-	 * string is "TcpTransport.lingerTime". The value is an integer between 0
-	 * and 240. The default is 30.
-	 */
-	public final static String LINGER_TIME = "TcpTransport.lingerTime";
-
-	/**
-	 * Term on the uri which specifies the no delay flag. The term string is
-	 * "TcpTransport.noDelay". The value is "true" or "false". The default is
-	 * "true".
-	 */
-	public final static String NO_DELAY = "TcpTransport.noDelay";
-	
-	/**
-	 * Term on the uri which specifies the reconnect delay in milliseconds. The
-	 * term string is "TcpTransport.reconnectDelay". The value is an integer >=
-	 * 0. The default is 0.
-	 */
-	public final static String RECONNECT_DELAY = "TcpTransport.reconnectDelay";
-
-	/**
-	 * Term on the uri which specifies the traffic class. The term string is
-	 * "TcpTransport.trafficClass". The value is an integer between 0 and 255.
-	 * The default is 0.
-	 */
-	public final static String TRAFFIC_CLASS = "TcpTransport.trafficClass";
-
-	/**
 	 * Constructs the TcpTransport. Pulls common parameters off the uri.
 	 *
 	 * @param uri
@@ -93,89 +44,10 @@
 	 */
 	protected TcpTransport( URL uri, Resources resources )
 	{
-		setDefaultAutoFlush( uri.getBooleanTerm( AUTO_FLUSH, false ) );
-		setDefaultBufferSize( uri.getIntegerTerm( BUFFER_SIZE, 0 ) );
-		setDefaultKeepAlive( uri.getBooleanTerm( KEEP_ALIVE, false ) );
-		setDefaultLingerTime( uri.getIntegerTerm( LINGER_TIME, 30 ) );
-		setDefaultNoDelay( uri.getBooleanTerm( NO_DELAY, true ) );
-		setDefaultReconnectDelay( uri.getIntegerTerm( RECONNECT_DELAY, 0 ) );
-		setDefaultTrafficClass( uri.getIntegerTerm( TRAFFIC_CLASS, 0 ) );
-	}
-
-	private void setDefaultAutoFlush( boolean autoFlush )
-	{
-		this.autoFlush = autoFlush;
+		options = new TcpOptions( uri, resources );
 	}
 	
-	/** The auto flush setting for this connection. If true, each call to send
-	 * must automatically call flush. */
-	protected boolean autoFlush;
-	
-	private void setDefaultBufferSize( int bufferSize )
-	{
-		if (bufferSize < 0 || bufferSize > 65536)
-			throw new IllegalArgumentException(
-				"bufferSize < 0 || bufferSize > 65536" );
-		this.bufferSize = bufferSize;
-	}
-	
-	/** The output buffer size to use for this connection. Bytes, 0 means
-	 * unbuffered output. If using buffered output, you'll want to disable
-	 * auto flush and call flush manually only when needed. */
-	protected int bufferSize;
-	
-	private void setDefaultKeepAlive( boolean keepAlive )
-	{
-		this.keepAlive = keepAlive;
-	}
-
-	/** The tcp keep alive setting for this connection. */
-	protected boolean keepAlive;
-	
-	private void setDefaultLingerTime( int lingerTime )
-	{
-		if (lingerTime < -1 || lingerTime > 240)
-			throw new IllegalArgumentException(
-				"lingerTime < -1 || lingerTime > 240" );
-		this.lingerTime = lingerTime;
-	}
-
-	/** The tcp linger time setting for this connection. Time in seconds, -1
-	 * means disable. */
-	protected int lingerTime;
-	
-	private void setDefaultNoDelay( boolean noDelay )
-	{
-		this.noDelay = noDelay;
-	}
-
-	/** The tcp no delay setting for this connection. True disables nagle's
-	 * algorithm and causes all sends to be made asap. */
-	protected boolean noDelay;
-	
-	private void setDefaultReconnectDelay( int reconnectDelay )
-	{
-		if (reconnectDelay < 0)
-			throw new IllegalArgumentException(
-				"reconnectDelay < 0" );
-		this.reconnectDelay = reconnectDelay;
-	}
-	
-	/** The reconnect delay for this connection. Time in milliseconds, 0 means
-	 * do not reconnect. */
-	protected int reconnectDelay;
-	
-	private void setDefaultTrafficClass( int trafficClass )
-	{
-		if (trafficClass < 0 || trafficClass > 255)
-			throw new IllegalArgumentException(
-				"trafficClass < 0 || trafficClass > 255" );
-		this.trafficClass = trafficClass;
-	}
-
-	/** The traffic class for this connection. 0-255, 0 means normal handling.
-	 * Also called type of service or dscp. */
-	protected int trafficClass;
+	private final TcpOptions options;
 	
 	@Override
 	protected final void stop0() throws Exception
@@ -267,9 +139,9 @@
 	 * @throws Exception if there is a problem transmitting the data. Such a
 	 * problem causes the current connection to be reset.
 	 * @see #flush()
-	 * @see #AUTO_FLUSH
-	 * @see #BUFFER_SIZE
-	 * @see #NO_DELAY
+	 * @see TcpOptions#AUTO_FLUSH
+	 * @see TcpOptions#BUFFER_SIZE
+	 * @see TcpOptions#NO_DELAY
 	 */
 	public final void send( byte[] buf ) throws Exception
 	{
@@ -289,9 +161,9 @@
 	 * @throws Exception if there is a problem transmitting the data. Such a
 	 * problem causes the current connection to be reset.
 	 * @see #flush()
-	 * @see #AUTO_FLUSH
-	 * @see #BUFFER_SIZE
-	 * @see #NO_DELAY
+	 * @see TcpOptions#AUTO_FLUSH
+	 * @see TcpOptions#BUFFER_SIZE
+	 * @see TcpOptions#NO_DELAY
 	 */
 	public final void send( byte[] buf, int off, int len )
 		throws Exception
@@ -300,7 +172,7 @@
 		{
 			OutputStream os = checkOutputStream();
 			os.write( buf, off, len );
-			if (autoFlush)
+			if (options.autoFlush)
 				os.flush();
 		}
 		catch ( IOException e )
@@ -391,16 +263,16 @@
 	{
 		Socket s = checkSocket();
 		
-		s.setKeepAlive( keepAlive );
-		s.setSoLinger( lingerTime >= 0, lingerTime >= 0 ? lingerTime : 0 );
-		s.setTcpNoDelay( noDelay );
-		s.setTrafficClass( trafficClass );
+		s.setKeepAlive( options.keepAlive );
+		s.setSoLinger( options.lingerTime >= 0, options.lingerTime >= 0 ? options.lingerTime : 0 );
+		s.setTcpNoDelay( options.noDelay );
+		s.setTrafficClass( options.trafficClass );
 		
 		inputStream = s.getInputStream();
 		
 		outputStream = s.getOutputStream();
-		if (bufferSize > 0)
-			outputStream = new BufferedOutputStream( outputStream, bufferSize );
+		if (options.bufferSize > 0)
+			outputStream = new BufferedOutputStream( outputStream, options.bufferSize );
 	}
 
 	/**
@@ -458,7 +330,7 @@
 			return false;
 		
 		// if a reconnect but no retries allowed, then bail.
-		if (reconnect && reconnectDelay == 0)
+		if (reconnect && options.reconnectDelay == 0)
 			return false;
 		
 		// ok, we don't have an existing socket, and this is either the first
@@ -475,10 +347,10 @@
 			
 			if (reconnect || !first)
 			{
-				if (reconnectDelay == 0)
+				if (options.reconnectDelay == 0)
 					return false;
 				
-				wait( reconnectDelay );
+				wait( options.reconnectDelay );
 				
 				if (!isStarted())
 					break;

Modified: incubator/etch/trunk/util/src/main/java/etch/util/core/io/TlsListener.java
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/util/src/main/java/etch/util/core/io/TlsListener.java?rev=719286&r1=719285&r2=719286&view=diff
==============================================================================
--- incubator/etch/trunk/util/src/main/java/etch/util/core/io/TlsListener.java (original)
+++ incubator/etch/trunk/util/src/main/java/etch/util/core/io/TlsListener.java Thu Nov 20 09:02:42 2008
@@ -21,6 +21,7 @@
 import java.io.IOException;
 import java.net.BindException;
 import java.net.InetAddress;
+import java.net.Socket;
 import java.net.SocketAddress;
 import java.net.SocketException;
 import java.security.KeyStore;
@@ -37,8 +38,8 @@
 /**
  * Implementation of a connection which handles a secure socket listener.
  */
-public class TlsListener extends Connection<SessionListener>
-	implements Transport<SessionListener>
+public class TlsListener extends Connection<SessionListener<Socket>>
+	implements Transport<SessionListener<Socket>>
 {
 	/**
 	 * Query term for URI to specify backlog value to ServerSocket. The value

Modified: incubator/etch/trunk/util/src/test/java/etch/util/core/io/TestListener.java
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/util/src/test/java/etch/util/core/io/TestListener.java?rev=719286&r1=719285&r2=719286&view=diff
==============================================================================
--- incubator/etch/trunk/util/src/test/java/etch/util/core/io/TestListener.java (original)
+++ incubator/etch/trunk/util/src/test/java/etch/util/core/io/TestListener.java Thu Nov 20 09:02:42 2008
@@ -329,7 +329,7 @@
 	/**
 	 * ListenerHandler for testing.
 	 */
-	public static class MyListenerHandler implements SessionListener
+	public static class MyListenerHandler implements SessionListener<Socket>
 	{
 		/** the event seen */
 		public Monitor<What> what = new Monitor<What>( null );
@@ -372,7 +372,7 @@
 	/**
 	 * ListenerHandler for testing.
 	 */
-	public static class MyOtherListenerHandler implements SessionListener
+	public static class MyOtherListenerHandler implements SessionListener<Socket>
 	{
 		/** count of accepted connections. */
 		public int accepted;

Modified: incubator/etch/trunk/util/src/test/java/etch/util/core/io/TestTcpConnection.java
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/util/src/test/java/etch/util/core/io/TestTcpConnection.java?rev=719286&r1=719285&r2=719286&view=diff
==============================================================================
--- incubator/etch/trunk/util/src/test/java/etch/util/core/io/TestTcpConnection.java (original)
+++ incubator/etch/trunk/util/src/test/java/etch/util/core/io/TestTcpConnection.java Thu Nov 20 09:02:42 2008
@@ -679,7 +679,7 @@
 	/**
 	 * ListenerHandler for testing.
 	 */
-	static class MyListener implements SessionListener
+	static class MyListener implements SessionListener<Socket>
 	{
 		/** monitor to report accepted socket */
 		public Monitor<Socket> accepted = new Monitor<Socket>( "accepted" );