directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r123500 - in incubator/directory/network/trunk/mina: . src/examples/org/apache/mina/examples/echoserver src/examples/org/apache/mina/examples/netcat src/examples/org/apache/mina/examples/reverser src/java/org/apache/mina/common src/java/org/apache/mina/io src/java/org/apache/mina/io/datagram src/java/org/apache/mina/io/filter src/java/org/apache/mina/io/socket src/java/org/apache/mina/protocol src/java/org/apache/mina/protocol/filter src/java/org/apache/mina/registry src/java/org/apache/mina/util src/test/org/apache/mina/examples/echoserver
Date Tue, 28 Dec 2004 13:11:06 GMT
Author: trustin
Date: Tue Dec 28 05:11:05 2004
New Revision: 123500

URL: http://svn.apache.org/viewcvs?view=rev&rev=123500
Log:
 * Finished JavaDocs
 * Added Examples Xref report
 * Moved DefaultExceptionMonitor to io package
 * Moved TransportType to common package

 * Added Session.getTransportType()
 * Added TransportType.isStateless()
 * Removed Session.isStateless()

 * Added jcoverage.ser to svn:ignore
Added:
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/package.html   (contents, props changed)
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/package.html   (contents, props changed)
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/package.html   (contents, props changed)
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/TransportType.java
      - copied, changed from r123487, incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/TransportType.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/package.html   (contents, props changed)
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/DefaultExceptionMonitor.java
      - copied, changed from r123487, incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/DefaultExceptionMonitor.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/package.html   (contents, props changed)
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/package.html   (contents, props changed)
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/package.html   (contents, props changed)
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/package.html   (contents, props changed)
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/filter/package.html   (contents, props changed)
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/package.html   (contents, props changed)
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/package.html   (contents, props changed)
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/package.html   (contents, props changed)
Removed:
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/TransportType.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/DefaultExceptionMonitor.java
Modified:
   incubator/directory/network/trunk/mina/   (props changed)
   incubator/directory/network/trunk/mina/maven.xml
   incubator/directory/network/trunk/mina/project.properties
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/Main.java
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/Main.java
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/Main.java
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolHandler.java
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.java
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java
   incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineEncoder.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/SessionConfig.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/Acceptor.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/Connector.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/ExceptionMonitor.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandler.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerAdapter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoSession.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramConnector.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramProcessor.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramSession.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketAcceptor.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketConnector.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketSession.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolCodecFactory.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoder.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoderOutput.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoder.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoderOutput.java   (contents, props changed)
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandler.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerAdapter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilterAdapter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolProvider.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolSession.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolViolationException.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/Service.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/ServiceRegistry.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/SimpleService.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/BasicSessionConfig.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/BlockingSet.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/ByteBuffers.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/ProtocolHandlerFilterManager.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Queue.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Stack.java
   incubator/directory/network/trunk/mina/src/test/org/apache/mina/examples/echoserver/Test.java   (contents, props changed)

Modified: incubator/directory/network/trunk/mina/maven.xml
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/maven.xml?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/maven.xml&r1=123499&p2=incubator/directory/network/trunk/mina/maven.xml&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/maven.xml	(original)
+++ incubator/directory/network/trunk/mina/maven.xml	Tue Dec 28 05:11:05 2004
@@ -1,9 +1,63 @@
-<project default="test" xmlns:ant="jelly:ant" xmlns:maven="jelly:maven">
+<project
+	default="test"
+  xmlns:define="jelly:define"
+	xmlns:ant="jelly:ant"
+	xmlns:doc="doc"
+  xmlns:j="jelly:core"  
+  xmlns:jxr="jxr"
+  xmlns:maven="jelly:maven"
+  xmlns:util="jelly:util">
+
+<!--
+	<define:taglib uri="jxr">
+		<define:jellybean
+			name="jxr"
+			className="org.apache.maven.jxr.JxrBean"
+			method="xref" />
+	</define:taglib>
+-->
 
 	<preGoal name="java:compile">
 		<ant:path id="my.other.src.dir" location="${basedir}/src/examples"/>
 		<maven:addPath id="maven.compile.src.set" refid="my.other.src.dir"/>
 	</preGoal>
+
+	<postGoal name="maven-jxr-plugin:register">
+		<doc:registerReport 
+			name="Examples Xref" 
+			pluginName="maven-jxr-plugin" 
+			link="xref-examples/index"
+			target="_blank"
+			description="A set of browsable cross-referenced example sources."/>
+	</postGoal>
+
+	<postGoal name="maven-jxr-plugin:report">
+		<maven:pluginVar var="javadocDestdir" plugin='maven-javadoc-plugin' property='maven.javadoc.destdir'/>
+		<maven:pluginVar var="stylesheetPath" plugin='maven-jxr-plugin' property='maven.jxr.stylesheet'/>
+		<maven:pluginVar var="templatePath" plugin='maven-jxr-plugin' property='maven.jxr.templateDir'/>
+
+		<j:set var="maven.jxr.destdir.examples"
+			value="${maven.docs.dest}/xref-examples" />
+
+		<j:set var="copyright"
+			value="Copyright &amp;copy; ${year} ${pom.organization.name}. All Rights Reserved." />
+
+		<j:set var="title" value="${pom.name} ${pom.currentVersion} Reference" />
+
+		<ant:mkdir dir="${maven.jxr.destdir.examples}" />
+		<ant:copy file="${stylesheetPath}"
+			tofile="${maven.jxr.destdir.examples}/stylesheet.css"/>
+
+		<jxr:jxr
+			sourceDir="${basedir}/src/examples"
+			destDir="${maven.jxr.destdir.examples}"
+			templateDir="${templatePath}"
+			javadocDir="${javadocDestdir}"
+			windowTitle="${title}"
+			docTitle="${title}"
+			bottom="${copyright}">
+		</jxr:jxr>
+	</postGoal>
 
 	<preGoal name="dist:build-src">
 		<ant:copy todir="${maven.dist.src.assembly.dir}">

Modified: incubator/directory/network/trunk/mina/project.properties
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/project.properties?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/project.properties&r1=123499&p2=incubator/directory/network/trunk/mina/project.properties&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/project.properties	(original)
+++ incubator/directory/network/trunk/mina/project.properties	Tue Dec 28 05:11:05 2004
@@ -18,6 +18,7 @@
 maven.junit.fork=no
 
 maven.javadoc.links = http://java.sun.com/j2se/1.4.2/docs/api/, http://www.junit.org/junit/javadoc/3.8.1/, http://gleamynode.net/dev/projects/netty2/apidocs/
+maven.javadoc.package = false
 
 # Eclipse settings.
 maven.eclipse.junit=3.8.1

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java	(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java	Tue Dec 28 05:11:05 2004
@@ -24,40 +24,42 @@
 import org.apache.mina.io.IoSession;
 
 /**
- * TODO Document me.
+ * {@link IoHandler} implementation for echo server. 
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$,
  */
 public class EchoProtocolHandler implements IoHandler
 {
-    public void sessionOpened( IoSession IoSession )
+    public void sessionOpened( IoSession session )
     {
         System.out.println( Thread.currentThread().getName() + ' '
-                            + IoSession.getRemoteAddress() + ": OPEN" );
+                            + session.getRemoteAddress() + ": OPEN" );
     }
 
-    public void sessionClosed( IoSession IoSession )
+    public void sessionClosed( IoSession session )
     {
         System.out.println( Thread.currentThread().getName() + ' '
-                            + IoSession.getRemoteAddress() + ": CLOSED" );
+                            + session.getRemoteAddress() + ": CLOSED" );
     }
 
-    public void sessionIdle( IoSession IoSession, IdleStatus status )
+    public void sessionIdle( IoSession session, IdleStatus status )
     {
         System.out.println( Thread.currentThread().getName() + ' '
-                            + IoSession.getRemoteAddress() + ": IDLE" );
+                            + session.getRemoteAddress() + ": IDLE" );
     }
 
-    public void exceptionCaught( IoSession IoSession, Throwable cause )
+    public void exceptionCaught( IoSession session, Throwable cause )
     {
         System.out.println( Thread.currentThread().getName() + ' '
-                            + IoSession.getRemoteAddress() + ": EXCEPTION" );
+                            + session.getRemoteAddress() + ": EXCEPTION" );
         cause.printStackTrace( System.out );
+        session.close();
     }
 
     public void dataRead( IoSession session, ByteBuffer rb )
     {
+    	// Write the received data back to remote peer
         ByteBuffer wb = ByteBuffer.allocate( rb.remaining() );
         wb.put( rb );
         wb.flip();
@@ -67,9 +69,9 @@
         session.write( wb, null );
     }
 
-    public void dataWritten( IoSession IoSession, Object marker )
+    public void dataWritten( IoSession session, Object marker )
     {
         System.out.println( Thread.currentThread().getName() + ' '
-                            + IoSession.getRemoteAddress() + ": WRITTEN" );
+                            + session.getRemoteAddress() + ": WRITTEN" );
     }
 }

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/Main.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/Main.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/Main.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/Main.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/Main.java	(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/Main.java	Tue Dec 28 05:11:05 2004
@@ -26,7 +26,7 @@
 import org.apache.mina.io.socket.SocketAcceptor;
 
 /**
- * TODO Document me.
+ * (<b>Entry point</b>) Echo server
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$,
@@ -37,17 +37,28 @@
 
     public static void main( String[] args ) throws Exception
     {
+        // Create a I/O thread pool filter 
+        IoThreadPoolFilter threadPoolFilter = new IoThreadPoolFilter();
+        threadPoolFilter.start(); // and start it
+        
+    	// Create a TCP/IP acceptor
         Acceptor acceptor = new SocketAcceptor();
 
-        IoThreadPoolFilter threadPoolFilter = new IoThreadPoolFilter();
-        threadPoolFilter.start();
+        // Add thread pool filter
+        // MINA runs in a single thread if you don't add this filter.
         acceptor.addFilter( Integer.MAX_VALUE, threadPoolFilter );
 
+        // Bind
         acceptor.bind( new InetSocketAddress( PORT ),
                        new EchoProtocolHandler() );
 
+        // Create a UDP/IP acceptor
         Acceptor datagramAcceptor = new DatagramAcceptor();
+        
+        // Add thread pool filter
         datagramAcceptor.addFilter( Integer.MAX_VALUE, threadPoolFilter );
+        
+        // Bind
         datagramAcceptor.bind( new InetSocketAddress( PORT ),
                                new EchoProtocolHandler() );
 

Added: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/package.html
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/package.html?view=auto&rev=123500
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/package.html	Tue Dec 28 05:11:05 2004
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
+Echo server.
+</body>
+</html>

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/Main.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/Main.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/Main.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/Main.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/Main.java	(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/Main.java	Tue Dec 28 05:11:05 2004
@@ -24,7 +24,9 @@
 import org.apache.mina.io.socket.SocketConnector;
 
 /**
- * TODO Document me.
+ * (<b>Entry point</b>) NetCat client.  NetCat client connects to the specified
+ * endpoint and prints out received data.  NetCat client disconnects
+ * automatically when no data is read for 10 seconds. 
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$,
@@ -39,8 +41,14 @@
             return;
         }
 
+        // Create TCP/IP connector.
         SocketConnector connector = new SocketConnector();
+        
+        // Add I/O thread pool filter.
+        // MINA runs in a single thread if you don't add this filter.
         connector.addFilter( Integer.MAX_VALUE, new IoThreadPoolFilter() );
+        
+        // Start communication.
         connector.connect( new InetSocketAddress( args[ 0 ], Integer
                 .parseInt( args[ 1 ] ) ), 60, new NetCatProtocolHandler() );
     }

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java	(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java	Tue Dec 28 05:11:05 2004
@@ -20,11 +20,13 @@
 
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
+import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoHandlerAdapter;
 import org.apache.mina.io.IoSession;
 
 /**
- * TODO Document me.
+ * {@link IoHandler} implementation for NetCat client.  This class extended
+ * {@link IoHandlerAdapter} for convenience. 
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$,
@@ -33,21 +35,28 @@
 {
     public void sessionOpened( IoSession session )
     {
+        // Set reader idle time to 10 seconds.
+        // sessionIdle(...) method will be invoked when no data is read
+        // for 10 seconds.
         session.getConfig().setIdleTime( IdleStatus.READER_IDLE, 10 );
     }
 
     public void sessionClosed( IoSession session )
     {
+        // Print out total number of bytes read from the remote peer.
         System.err.println( "Total " + session.getReadBytes() + " byte(s)" );
     }
 
     public void sessionIdle( IoSession session, IdleStatus status )
     {
-        session.close();
+        // Close the connection if reader is idle.
+        if ( status == IdleStatus.READER_IDLE )
+    	    session.close();
     }
 
     public void dataRead( IoSession session, ByteBuffer buf )
     {
+        // Print out read buffer content.
         while( buf.hasRemaining() )
         {
             System.out.print( ( char ) buf.get() );

Added: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/package.html
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/package.html?view=auto&rev=123500
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/package.html	Tue Dec 28 05:11:05 2004
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
+NetCat client (Network + Unix <code>cat</code> command).
+</body>
+</html>

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/Main.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/Main.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/Main.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/Main.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/Main.java	(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/Main.java	Tue Dec 28 05:11:05 2004
@@ -27,7 +27,8 @@
 import org.apache.mina.protocol.filter.ProtocolThreadPoolFilter;
 
 /**
- * TODO Document me.
+ * (<b>Entry point</b>) Reverser server which reverses all text lines from
+ * clients.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$,
@@ -38,17 +39,27 @@
 
     public static void main( String[] args ) throws Exception
     {
+    	// Create I/O and Protocol thread pool filter.
+    	// I/O thread pool performs encoding and decoding of messages.
+    	// Protocol thread pool performs actual protocol flow.
         IoThreadPoolFilter ioThreadPoolFilter = new IoThreadPoolFilter();
         ProtocolThreadPoolFilter protocolThreadPoolFilter = new ProtocolThreadPoolFilter();
+        
+        // and start both.
         ioThreadPoolFilter.start();
         protocolThreadPoolFilter.start();
 
+        // Create TCP/IP acceptor.
         Acceptor acceptor = new SocketAcceptor();
+        
+        // Create an I/O adapter to adapt ProtocolProvider to IoHandler.
         IoAdapter ioAdapter = new IoAdapter();
 
+        // Add both thread pool filters.
         acceptor.addFilter( Integer.MAX_VALUE, ioThreadPoolFilter );
         ioAdapter.addFilter( Integer.MAX_VALUE, protocolThreadPoolFilter );
 
+        // Bind
         acceptor.bind( new InetSocketAddress( PORT ), ioAdapter
                 .adapt( new ReverseProtocolProvider() ) );
 

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolHandler.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolHandler.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolHandler.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolHandler.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolHandler.java	(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolHandler.java	Tue Dec 28 05:11:05 2004
@@ -23,7 +23,7 @@
 import org.apache.mina.protocol.ProtocolSession;
 
 /**
- * TODO Document me.
+ * {@link ProtocolHandler} implementation of reverser server protocol.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$,
@@ -51,6 +51,8 @@
     {
         System.out.println( session.getRemoteAddress() + " EXCEPTION" );
         cause.printStackTrace( System.out );
+        
+        // Close connection when unexpected exception is caught.
         session.close();
     }
 
@@ -58,6 +60,7 @@
     {
         System.out.println( session.getRemoteAddress() + " RCVD: " + message );
 
+        // Reverse reveiced string
         String str = message.toString();
         StringBuffer buf = new StringBuffer( str.length() );
         for( int i = str.length() - 1; i >= 0; i-- )
@@ -65,11 +68,13 @@
             buf.append( str.charAt( i ) );
         }
 
+        // and write it back.
         session.write( buf.toString() );
     }
 
     public void messageSent( ProtocolSession session, Object message )
     {
+    	// Invoked the reversed string is actually written to socket channel.
         System.out.println( session.getRemoteAddress() + " SENT: " + message );
     }
 }

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.java	(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.java	Tue Dec 28 05:11:05 2004
@@ -25,7 +25,7 @@
 import org.apache.mina.protocol.ProtocolProvider;
 
 /**
- * TODO Document me.
+ * {@link ProtocolProvider} implementation for reverser server protocol.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$,
@@ -33,17 +33,21 @@
 public class ReverseProtocolProvider implements ProtocolProvider
 {
 
+    // Protocol handler is usually a singleton.
     private static ProtocolHandler HANDLER = new ReverseProtocolHandler();
 
+    // Codec factory is also usually a singleton.
     private static ProtocolCodecFactory CODEC_FACTORY = new ProtocolCodecFactory()
     {
         public ProtocolEncoder newEncoder()
         {
+        	// Create a new encoder.
             return new TextLineEncoder();
         }
 
         public ProtocolDecoder newDecoder()
         {
+        	// Create a new decoder.
             return new TextLineDecoder();
         }
     };

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java	(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineDecoder.java	Tue Dec 28 05:11:05 2004
@@ -25,7 +25,7 @@
 import org.apache.mina.protocol.ProtocolViolationException;
 
 /**
- * TODO Document me.
+ * Decodes a text line into a string.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$,
@@ -55,6 +55,7 @@
                 decodeBuf.append( ( char ) b );
             }
 
+            // Don't accept too long line
             if( decodeBuf.length() > 256 )
             {
                 decodeBuf.delete( 0, decodeBuf.length() );

Modified: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineEncoder.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineEncoder.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineEncoder.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineEncoder.java	(original)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/TextLineEncoder.java	Tue Dec 28 05:11:05 2004
@@ -25,7 +25,7 @@
 import org.apache.mina.protocol.ProtocolViolationException;
 
 /**
- * TODO Document me.
+ * Encodes a string into a text line which ends with <code>"\r\n"</code>.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$,
@@ -39,6 +39,7 @@
     {
 
         String val = message.toString();
+        // Don't accept too long strings.
         if( val.length() > 256 )
         {
             throw new ProtocolViolationException(

Added: incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/package.html
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/package.html?view=auto&rev=123500
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/reverser/package.html	Tue Dec 28 05:11:05 2004
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
+Reverser server which reverses all text lines.
+</body>
+</html>

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/SessionConfig.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/SessionConfig.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/SessionConfig.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/SessionConfig.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/SessionConfig.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/SessionConfig.java	Tue Dec 28 05:11:05 2004
@@ -18,9 +18,11 @@
  */
 package org.apache.mina.common;
 
+import org.apache.mina.io.IoSession;
 import org.apache.mina.io.WriteTimeoutException;
 import org.apache.mina.io.datagram.DatagramSessionConfig;
 import org.apache.mina.io.socket.SocketSessionConfig;
+import org.apache.mina.protocol.ProtocolSession;
 
 /**
  * Provides general or transport-specific configuration.
@@ -35,6 +37,9 @@
  * <p>
  * Please refer to {@link SocketSessionConfig} and {@link DatagramSessionConfig}
  * for transport-specific configurations.
+ * <p>
+ * {@link SessionConfig} can be obtained by {@link IoSession#getConfig()} and
+ * by {@link ProtocolSession#getConfig()}.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$

Copied: incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/TransportType.java (from r123487, incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/TransportType.java)
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/TransportType.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/TransportType.java&r1=123487&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/TransportType.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/TransportType.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/TransportType.java	Tue Dec 28 05:11:05 2004
@@ -16,35 +16,50 @@
  *   limitations under the License.
  *
  */
-package org.apache.mina.registry;
+package org.apache.mina.common;
 
 /**
- * TODO Insert type comment.
+ * Represents network transport types.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */
 public class TransportType
 {
-    public static final TransportType SOCKET = new TransportType( "SOCKET" );
-
-    public static final TransportType DATAGRAM = new TransportType( "DATAGRAM" );
-
-    public static final TransportType MULTICAST = new TransportType(
-                                                                     "MULTICAST" );
-
-    public static final TransportType VM = new TransportType( "VM" );
+	/**
+	 * Transport type: TCP/IP (<code>SocketChannel</code>)
+	 */
+    public static final TransportType SOCKET = new TransportType( "SOCKET",
+                                                                  false );
+
+	/**
+	 * Transport type: UDP/IP (<code>DatagramChannel</code>)
+	 */
+    public static final TransportType DATAGRAM = new TransportType( "DATAGRAM",
+                                                                    true );
 
     private final String strVal;
+    
+    private final boolean stateless;
 
     /**
      * Creates a new instance.
      */
-    private TransportType( String strVal )
+    private TransportType( String strVal, boolean stateless )
     {
         this.strVal = strVal;
+        this.stateless = stateless;
     }
 
+    /**
+     * Returns <code>true</code> if the session of this transport type is
+     * stateless.
+     */
+    public boolean isStateless()
+    {
+    	return stateless;
+    }
+    
     public String toString()
     {
         return strVal;

Added: incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/package.html
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/package.html?view=auto&rev=123500
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/common/package.html	Tue Dec 28 05:11:05 2004
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
+Common types required for users to use MINA.
+</body>
+</html>

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/Acceptor.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/Acceptor.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/Acceptor.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/Acceptor.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/Acceptor.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/Acceptor.java	Tue Dec 28 05:11:05 2004
@@ -21,11 +21,14 @@
 import java.io.IOException;
 import java.net.SocketAddress;
 
-import org.apache.mina.util.DefaultExceptionMonitor;
 
 /**
  * Accepts incoming connection, communicates with clients, and fires events to
  * {@link IoHandler}s.
+ * <p>
+ * Please refer to
+ * <a href="../../../../../xref-examples/org/apache/mina/examples/echoserver/Main.html">EchoServer</a>
+ * example. 
  * <p>
  * You should bind to the desired socket address to accept incoming
  * connections, and then events for incoming connections will be sent to

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/Connector.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/Connector.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/Connector.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/Connector.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/Connector.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/Connector.java	Tue Dec 28 05:11:05 2004
@@ -21,11 +21,14 @@
 import java.io.IOException;
 import java.net.SocketAddress;
 
-import org.apache.mina.util.DefaultExceptionMonitor;
 
 /**
  * Connects to endpoint, communicates with the server, and fires events to
  * {@link IoHandler}s.
+ * <p>
+ * Please refer to
+ * <a href="../../../../../xref-examples/org/apache/mina/examples/netcat/Main.html">NetCat</a>
+ * example. 
  * <p>
  * You should connect to the desired socket address to start communication,
  * and then events for incoming connections will be sent to the specified

Copied: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/DefaultExceptionMonitor.java (from r123487, incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/DefaultExceptionMonitor.java)
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/DefaultExceptionMonitor.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/DefaultExceptionMonitor.java&r1=123487&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/DefaultExceptionMonitor.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/DefaultExceptionMonitor.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/DefaultExceptionMonitor.java	Tue Dec 28 05:11:05 2004
@@ -16,19 +16,18 @@
  *   limitations under the License.
  *
  */
-package org.apache.mina.util;
+package org.apache.mina.io;
 
 import java.lang.reflect.Method;
 import java.text.DateFormat;
 import java.util.Date;
 
-import org.apache.mina.io.ExceptionMonitor;
 
 /**
- * A default {@link ExceptionMonitor}.  It logs uncaught exceptions using
- * <a href="http://jakarta.apache.org/commons/logging/">Apache Jakarta Commons
- * Logging</a> if available.  If not available, it prints it out to
- * {@link System#err}.
+ * A default {@link ExceptionMonitor} implementation.  It logs uncaught
+ * exceptions using <a href="http://jakarta.apache.org/commons/logging/">Apache
+ * Jakarta Commons Logging</a> if available.  If not available, it prints it
+ * out to {@link System#err}.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/ExceptionMonitor.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/ExceptionMonitor.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/ExceptionMonitor.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/ExceptionMonitor.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/ExceptionMonitor.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/ExceptionMonitor.java	Tue Dec 28 05:11:05 2004
@@ -18,12 +18,15 @@
  */
 package org.apache.mina.io;
 
+
 /**
  * Monitors uncaught exceptions.  {@link #exceptionCaught(Object, Throwable)} is
  * invoked when there are any uncaught exceptions.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
+ * 
+ * @see DefaultExceptionMonitor
  */
 public interface ExceptionMonitor
 {

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandler.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandler.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandler.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandler.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandler.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandler.java	Tue Dec 28 05:11:05 2004
@@ -28,9 +28,15 @@
  * There are 6 event handler methods, and they are all invoked by MINA
  * automatically.  Most users of MINA I/O package will be OK with this single
  * interface to implement their protocols.
+ * <p>
+ * Please refer to
+ * <a href="../../../../../xref-examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.html"><code>EchoProtocolHandler</code></a>
+ * example. 
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
+ * 
+ * @see IoHandlerAdapter
  */
 public interface IoHandler
 {

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerAdapter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerAdapter.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerAdapter.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerAdapter.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerAdapter.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerAdapter.java	Tue Dec 28 05:11:05 2004
@@ -20,12 +20,14 @@
 
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
-import org.apache.mina.examples.netcat.NetCatProtocolHandler;
 
 /**
  * An abstract adapter class for {@link IoHandler}.  You can extend this class
  * and selectively override required event handler methods only.  All methods
- * do nothing by default.  Please refer to {@link NetCatProtocolHandler} for
+ * do nothing by default.
+ * <p>
+ * Please refer to
+ * <a href="../../../../../xref-examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.html"><code>NetCatProtocolHandler</code></a>
  * example. 
  * 
  * @author Trustin Lee (trustin@apache.org)

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java	Tue Dec 28 05:11:05 2004
@@ -20,14 +20,25 @@
 
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
-import org.apache.mina.io.filter.BlacklistFilter;
 
 /**
  * A filter which intercepts {@link IoHandler} events like Servlet filters.
- * Please refer to {@link BlacklistFilter} for example.
+ * Filters can be used for these purposes:
+ * <ul>
+ *   <li>Event logging,</li>
+ *   <li>Performance measurement,</li>
+ *   <li>Data transformation (e.g. SSL support),</li>
+ *   <li>Firewalling,</li>
+ *   <li>and many more.</li>
+ * </ul>
+ * <p>
+ * Please refer to <a href="../../../../../xref/org/apache/mina/io/filter/BlacklistFilter.html"><code>BlacklistFilter</code></a>
+ * example.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
+ * 
+ * @see IoHandlerFilterAdapter
  */
 public interface IoHandlerFilter
 {

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java	Tue Dec 28 05:11:05 2004
@@ -20,13 +20,15 @@
 
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
-import org.apache.mina.io.filter.BlacklistFilter;
 
 /**
  * An abstract adapter class for {@link IoHandlerFilter}.  You can extend this
  * class and selectively override required event filter methods only.  All
- * methods forwards events to the next filter by default.  Please refer to
- * {@link BlacklistFilter} for example.
+ * methods forwards events to the next filter by default.
+ * <p>
+ * Please refer to
+ * <a href="../../../../../xref/org/apache/mina/io/filter/BlacklistFilter.html"><code>BlacklistFilter</code></a>
+ * example.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoSession.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoSession.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoSession.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoSession.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoSession.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoSession.java	Tue Dec 28 05:11:05 2004
@@ -23,6 +23,7 @@
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.SessionConfig;
+import org.apache.mina.common.TransportType;
 
 /**
  * A handle which represents connection between two endpoints regardless of 
@@ -67,13 +68,12 @@
     void setAttachment( Object attachment );
 
     /**
-     * Returns <code>true</code> if this session is stateless.  This method
-     * returns the transport type is UDP/IP currently.
+     * Returns transport type of this session.
      */
-    boolean isStateless();
+    TransportType getTransportType();
 
     /**
-     * Returns <code>true</code> if this session is connected.
+     * Returns <code>true</code> if this session is connected with remote peer.
      */
     boolean isConnected();
 

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java	Tue Dec 28 05:11:05 2004
@@ -32,10 +32,10 @@
 
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.io.Acceptor;
+import org.apache.mina.io.DefaultExceptionMonitor;
 import org.apache.mina.io.ExceptionMonitor;
 import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoHandlerFilter;
-import org.apache.mina.util.DefaultExceptionMonitor;
 import org.apache.mina.util.IoHandlerFilterManager;
 import org.apache.mina.util.Queue;
 
@@ -45,7 +45,7 @@
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */
-public class DatagramAcceptor implements Acceptor, DatagramProcessor
+public class DatagramAcceptor extends DatagramProcessor implements Acceptor
 {
     private static volatile int nextId = 0;
 

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramConnector.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramConnector.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramConnector.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramConnector.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramConnector.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramConnector.java	Tue Dec 28 05:11:05 2004
@@ -30,11 +30,11 @@
 
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.io.Connector;
+import org.apache.mina.io.DefaultExceptionMonitor;
 import org.apache.mina.io.ExceptionMonitor;
 import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoHandlerFilter;
 import org.apache.mina.io.IoSession;
-import org.apache.mina.util.DefaultExceptionMonitor;
 import org.apache.mina.util.IoHandlerFilterManager;
 import org.apache.mina.util.Queue;
 
@@ -44,7 +44,7 @@
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */
-public class DatagramConnector implements Connector, DatagramProcessor
+public class DatagramConnector extends DatagramProcessor implements Connector
 {
     private static volatile int nextId = 0;
 

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramProcessor.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramProcessor.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramProcessor.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramProcessor.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramProcessor.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramProcessor.java	Tue Dec 28 05:11:05 2004
@@ -19,21 +19,22 @@
 package org.apache.mina.io.datagram;
 
 /**
- * A base interface for {@link DatagramAcceptor and DatagramConnector}.
- * Session interacts with this interface instead of those two concrete classes.
+ * A base class for {@link DatagramAcceptor} and {@link DatagramConnector}.
+ * Session interacts with this abstract class instead of those two concrete
+ * classes.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */
-interface DatagramProcessor
+abstract class DatagramProcessor
 {
     /**
-     * This method is invoked by MINA internally, so please don't call this.
+     * This method is invoked by MINA internally.
      */
-    void flushSession( DatagramSession session );
+    abstract void flushSession( DatagramSession session );
 
     /**
-     * This method is invoked by MINA internally, so please don't call this.
+     * This method is invoked by MINA internally.
      */
-    void closeSession( DatagramSession session );
+    abstract void closeSession( DatagramSession session );
 }

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramSession.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramSession.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramSession.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramSession.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramSession.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/DatagramSession.java	Tue Dec 28 05:11:05 2004
@@ -25,6 +25,7 @@
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.SessionConfig;
+import org.apache.mina.common.TransportType;
 import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoSession;
 import org.apache.mina.util.IoHandlerFilterManager;
@@ -152,9 +153,9 @@
         parent.flushSession( this );
     }
 
-    public boolean isStateless()
+    public TransportType getTransportType()
     {
-        return true;
+        return TransportType.DATAGRAM;
     }
 
     public boolean isConnected()

Added: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/package.html
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/package.html?view=auto&rev=123500
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/datagram/package.html	Tue Dec 28 05:11:05 2004
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
+Datagram (UDP/IP) support.
+</body>
+</html>

Added: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/package.html
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/package.html?view=auto&rev=123500
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/package.html	Tue Dec 28 05:11:05 2004
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
+Basic <code>IoHandlerFilter</code> implementations.
+</body>
+</html>

Added: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/package.html
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/package.html?view=auto&rev=123500
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/package.html	Tue Dec 28 05:11:05 2004
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
+Low-level protocol implementation layer (I/O layer).
+</body>
+</html>

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketAcceptor.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketAcceptor.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketAcceptor.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketAcceptor.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketAcceptor.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketAcceptor.java	Tue Dec 28 05:11:05 2004
@@ -31,10 +31,10 @@
 import java.util.Map;
 
 import org.apache.mina.io.Acceptor;
+import org.apache.mina.io.DefaultExceptionMonitor;
 import org.apache.mina.io.ExceptionMonitor;
 import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoHandlerFilter;
-import org.apache.mina.util.DefaultExceptionMonitor;
 import org.apache.mina.util.IoHandlerFilterManager;
 import org.apache.mina.util.Queue;
 

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketConnector.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketConnector.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketConnector.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketConnector.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketConnector.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketConnector.java	Tue Dec 28 05:11:05 2004
@@ -29,11 +29,11 @@
 import java.util.Set;
 
 import org.apache.mina.io.Connector;
+import org.apache.mina.io.DefaultExceptionMonitor;
 import org.apache.mina.io.ExceptionMonitor;
 import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoHandlerFilter;
 import org.apache.mina.io.IoSession;
-import org.apache.mina.util.DefaultExceptionMonitor;
 import org.apache.mina.util.IoHandlerFilterManager;
 
 /**

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketIoProcessor.java	Tue Dec 28 05:11:05 2004
@@ -32,7 +32,8 @@
 import org.apache.mina.util.Queue;
 
 /**
- * TODO Document me.
+ * Performs core I/O operations for sockets.  This class is used by MINA
+ * internally.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$,
@@ -79,12 +80,12 @@
         selector = Selector.open();
     }
 
-    public static SocketIoProcessor getInstance()
+    static SocketIoProcessor getInstance()
     {
         return instance;
     }
 
-    public void addSession( SocketSession session )
+    void addSession( SocketSession session )
     {
         synchronized( this )
         {
@@ -103,19 +104,19 @@
         selector.wakeup();
     }
 
-    public void removeSession( SocketSession session )
+    void removeSession( SocketSession session )
     {
         scheduleRemove( session );
         selector.wakeup();
     }
 
-    public void flushSession( SocketSession session )
+    void flushSession( SocketSession session )
     {
         scheduleFlush( session );
         selector.wakeup();
     }
 
-    public void addReadableSession( SocketSession session )
+    void addReadableSession( SocketSession session )
     {
         synchronized( readableSessions )
         {

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketSession.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketSession.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketSession.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketSession.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketSession.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/SocketSession.java	Tue Dec 28 05:11:05 2004
@@ -25,6 +25,7 @@
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.SessionConfig;
+import org.apache.mina.common.TransportType;
 import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoSession;
 import org.apache.mina.util.IoHandlerFilterManager;
@@ -163,9 +164,9 @@
         SocketIoProcessor.getInstance().flushSession( this );
     }
 
-    public boolean isStateless()
+    public TransportType getTransportType()
     {
-        return false;
+        return TransportType.SOCKET;
     }
 
     public boolean isConnected()

Added: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/package.html
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/package.html?view=auto&rev=123500
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/package.html	Tue Dec 28 05:11:05 2004
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
+Socket (TCP/IP) support.
+</body>
+</html>

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java	Tue Dec 28 05:11:05 2004
@@ -23,6 +23,7 @@
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.SessionConfig;
+import org.apache.mina.common.TransportType;
 import org.apache.mina.io.Acceptor;
 import org.apache.mina.io.Connector;
 import org.apache.mina.io.IoHandler;
@@ -45,6 +46,10 @@
  * acceptor.bind(new InetSocketAddress(...), handler);
  * </pre>
  * <p>
+ * Please refer to more realistic
+ * <a href="../../../../../xref-examples/org/apache/mina/examples/reverser/Main.html">Reverser</a>
+ * example.
+ * <p>
  * {@link IoAdapter} supports protocol-level filters like {@link Acceptor}s and
  * {@link Connector}s.  It is the same with {@link IoHandlerFilter} and Servlet
  * filters and effective immediately.
@@ -161,6 +166,11 @@
                     }
                 }
             }
+            catch( ProtocolViolationException pve )
+			{
+            	pve.setBuffer(in);
+            	filterManager.fireExceptionCaught( psession, pve );
+			}
             catch( Throwable t )
             {
                 filterManager.fireExceptionCaught( psession, t );
@@ -294,7 +304,7 @@
             this.attachment = attachment;
         }
 
-        public boolean write( Object message )
+        public void write( Object message )
         {
             synchronized( writeQueue )
             {
@@ -302,12 +312,11 @@
             }
 
             adapter.write( session );
-            return true;
         }
 
-        public boolean isStateless()
+        public TransportType getTransportType()
         {
-            return session.isStateless();
+            return session.getTransportType();
         }
 
         public boolean isConnected()
@@ -328,6 +337,16 @@
         public SocketAddress getLocalAddress()
         {
             return session.getLocalAddress();
+        }
+        
+        public long getReadBytes()
+        {
+        	return session.getReadBytes();
+        }
+
+        public long getWrittenBytes()
+        {
+        	return session.getWrittenBytes();
         }
 
         public long getLastIoTime()

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolCodecFactory.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolCodecFactory.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolCodecFactory.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolCodecFactory.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolCodecFactory.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolCodecFactory.java	Tue Dec 28 05:11:05 2004
@@ -19,9 +19,13 @@
 package org.apache.mina.protocol;
 
 /**
- * provides {@link ProtocolEncoder} and {@link ProtocolDecoder} which translates
+ * Provides {@link ProtocolEncoder} and {@link ProtocolDecoder} which translates
  * binary or protocol specific data into message object and vice versa.
- * 
+ * <p>
+ * Please refer to
+ * <a href="../../../../../xref-examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.html"><code>ReverserProtocolProvider</code></a>
+ * example.
+ *  
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoder.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoder.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoder.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoder.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoder.java	Tue Dec 28 05:11:05 2004
@@ -24,7 +24,12 @@
  * Decodes binary or protocol-specific data into higher-level message objects.
  * MINA invokes {@link #decode(ProtocolSession, ByteBuffer, ProtocolDecoderOutput)}
  * method with read data, and then the decoder implementation puts decoded
- * messages into {@link ProtocolDecoderOutput}.
+ * messages into {@link ProtocolDecoderOutput} by calling
+ * {@link ProtocolDecoderOutput#write(Object)}.
+ * <p>
+ * Please refer to
+ * <a href="../../../../../xref-examples/org/apache/mina/examples/reverser/TextLineDecoder.html"><code>TextLineDecoder</code></a>
+ * example. 
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoderOutput.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoderOutput.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoderOutput.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoderOutput.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoderOutput.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolDecoderOutput.java	Tue Dec 28 05:11:05 2004
@@ -19,12 +19,21 @@
 package org.apache.mina.protocol;
 
 /**
- * TODO Document me.
+ * Callback for {@link ProtocolDecoder} to generate decoded messages.
+ * {@link ProtocolDecoder} must call {@link #write(Object)} for each decoded
+ * messages.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */
 public interface ProtocolDecoderOutput
 {
+	/**
+     * Callback for {@link ProtocolDecoder} to generate decoded messages.
+     * {@link ProtocolDecoder} must call {@link #write(Object)} for each
+     * decoded messages.
+     * 
+     * @param message the decoded message
+	 */
     void write( Object message );
 }

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoder.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoder.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoder.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoder.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoder.java	Tue Dec 28 05:11:05 2004
@@ -25,7 +25,12 @@
  * MINA invokes {@link #encode(ProtocolSession, Object, ProtocolEncoderOutput)}
  * method with message which is popped from the session write queue, and then
  * the encoder implementation puts encoded {@link ByteBuffer}s into
- * {@link ProtocolEncoderOutput}.
+ * {@link ProtocolEncoderOutput} by calling
+ * {@link ProtocolEncoderOutput#write(ByteBuffer)}.
+ * <p>
+ * Please refer to
+ * <a href="../../../../../xref-examples/org/apache/mina/examples/reverser/TextLineEncoder.html"><code>TextLineEncoder</code></a>
+ * example. 
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoderOutput.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoderOutput.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoderOutput.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoderOutput.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoderOutput.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolEncoderOutput.java	Tue Dec 28 05:11:05 2004
@@ -1,5 +1,5 @@
 /*
- *   @(#) $Id: ProtocolEncoder.java 122629 2004-12-17 08:14:08Z trustin $
+ *   @(#) $Id$
  *
  *   Copyright 2004 The Apache Software Foundation
  *
@@ -21,12 +21,21 @@
 import org.apache.mina.common.ByteBuffer;
 
 /**
- * TODO Document me.
+ * Callback for {@link ProtocolEncoder} to generate encoded {@link ByteBuffer}s.
+ * {@link ProtocolEncoder} must call {@link #write(ByteBuffer)} for each decoded
+ * messages.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */
 public interface ProtocolEncoderOutput
 {
+	/**
+	 * Callback for {@link ProtocolEncoder} to generate encoded
+	 * {@link ByteBuffer}s. {@link ProtocolEncoder} must call
+	 * {@link #write(ByteBuffer)} for each decoded messages.
+	 * 
+	 * @param buf the buffer which contains encoded data
+	 */
     void write( ByteBuffer buf );
 }

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandler.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandler.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandler.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandler.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandler.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandler.java	Tue Dec 28 05:11:05 2004
@@ -18,25 +18,61 @@
  */
 package org.apache.mina.protocol;
 
+import java.io.IOException;
+
 import org.apache.mina.common.IdleStatus;
 
 /**
- * TODO Insert type comment.
+ * Handles all protocol events fired by MINA.
+ * There are 6 event handler methods, and they are all invoked by MINA
+ * automatically.
+ * <p>
+ * Please refer to
+ * <a href="../../../../../xref-examples/org/apache/mina/examples/reverser/ReverseProtocolHandler.html"><code>ReverseProtocolHandler</code></a>
+ * example.
+ * 
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
+ * 
+ * @see ProtocolHandlerAdapter
  */
 public interface ProtocolHandler
 {
+    /**
+     * Invoked when the connection is opened.  This method is not invoked if the
+     * transport type is UDP.
+     */
     void sessionOpened( ProtocolSession session );
 
+    /**
+     * Invoked when the connection is closed.  This method is not invoked if the
+     * transport type is UDP.
+     */
     void sessionClosed( ProtocolSession session );
 
+    /**
+     * Invoked when the connection is idle.  Refer to {@link IdleStatus}.  This
+     * method is not invoked if the transport type is UDP.
+     */
     void sessionIdle( ProtocolSession session, IdleStatus status );
 
+    /**
+     * Invoked when any exception is thrown by user {@link ProtocolHandler}
+     * implementation or by MINA.  If <code>cause</code> is instanceof
+     * {@link IOException}, MINA will close the connection automatically.
+     */
     void exceptionCaught( ProtocolSession session, Throwable cause );
 
+    /**
+     * Invoked when protocol message is received.  Implement your protocol flow
+     * here.
+     */
     void messageReceived( ProtocolSession session, Object message );
 
+    /**
+     * Invoked when protocol message that user requested by
+     * {@link ProtocolSession#write(Object)} is sent out actually.
+     */
     void messageSent( ProtocolSession session, Object message );
 }

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerAdapter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerAdapter.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerAdapter.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerAdapter.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerAdapter.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerAdapter.java	Tue Dec 28 05:11:05 2004
@@ -21,7 +21,9 @@
 import org.apache.mina.common.IdleStatus;
 
 /**
- * TODO Document me.
+ * An abstract adapter class for {@link ProtocolHandler}.  You can extend this
+ * class and selectively override required event handler methods only.  All
+ * methods do nothing by default. 
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilter.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilter.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilter.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilter.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilter.java	Tue Dec 28 05:11:05 2004
@@ -21,26 +21,59 @@
 import org.apache.mina.common.IdleStatus;
 
 /**
- * TODO Insert type comment.
+ * A filter which intercepts {@link ProtocolHandler} events like Servlet
+ * filters.  Filters can be used for these purposes:
+ * <ul>
+ *   <li>Event logging,</li>
+ *   <li>Performance measurement,</li>
+ *   <li>Authorization,</li>
+ *   <li>Overload control,</li>
+ *   <li>Message transformation (e.g. encryption and decryption, ...),</li>
+ *   <li>and many more.</li>
+ * </ul>
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
+ * 
+ * @see ProtocolHandlerFilterAdapter
  */
 public interface ProtocolHandlerFilter
 {
+    /**
+     * Filters {@link ProtocolHandler#sessionOpened(ProtocolSession)} event.
+     */
     void sessionOpened( ProtocolHandler nextHandler, ProtocolSession session );
 
+    /**
+     * Filters {@link ProtocolHandler#sessionClosed(ProtocolSession)} event.
+     */
     void sessionClosed( ProtocolHandler nextHandler, ProtocolSession session );
 
+    /**
+     * Filters {@link ProtocolHandler#sessionIdle(ProtocolSession,IdleStatus)}
+     * event.
+     */
     void sessionIdle( ProtocolHandler nextHandler, ProtocolSession session,
                      IdleStatus status );
 
+    /**
+     * Filters {@link ProtocolHandler#exceptionCaught(ProtocolSession,Throwable)}
+     * event.
+     */
     void exceptionCaught( ProtocolHandler nextHandler,
                          ProtocolSession session, Throwable cause );
 
+    /**
+     * Filters {@link ProtocolHandler#messageReceived(ProtocolSession,Object)}
+     * event.
+     */
     void messageReceived( ProtocolHandler nextHandler,
                          ProtocolSession session, Object message );
 
+    /**
+     * Filters {@link ProtocolHandler#messageSent(ProtocolSession,Object)}
+     * event.
+     */
     void messageSent( ProtocolHandler nextHandler, ProtocolSession session,
                      Object message );
 }

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilterAdapter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilterAdapter.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilterAdapter.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilterAdapter.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilterAdapter.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilterAdapter.java	Tue Dec 28 05:11:05 2004
@@ -21,7 +21,9 @@
 import org.apache.mina.common.IdleStatus;
 
 /**
- * TODO Document me.
+ * An abstract adapter class for {@link ProtocolHandlerFilter}.  You can extend
+ * this class and selectively override required event filter methods only.  All
+ * methods forwards events to the next filter by default.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolProvider.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolProvider.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolProvider.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolProvider.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolProvider.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolProvider.java	Tue Dec 28 05:11:05 2004
@@ -33,6 +33,10 @@
  * If once you implement {@link ProtocolProvider} for your protocol, you can
  * adapt it into {@link IoHandler} using {@link IoAdapter} to work with I/O
  * layer which does actual I/O operations.
+ * <p>
+ * Please refer to
+ * <a href="../../../../../xref-examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.html"><code>ReverserProtocolProvider</code></a>
+ * example. 
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolSession.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolSession.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolSession.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolSession.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolSession.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolSession.java	Tue Dec 28 05:11:05 2004
@@ -22,44 +22,113 @@
 
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.SessionConfig;
+import org.apache.mina.common.TransportType;
 
 /**
- * TODO Insert type comment.
+ * A handle which represents high-level protocol connection between two
+ * endpoints regardless of underlying transport types.
+ * <p>
+ * Session provides an attachment per session ({@link #getAttachment()} and
+ * {@link #setAttachment(Object)}).  Attachment is an application-specific data
+ * which is associated with a session.  It is often an object that represents
+ * the state of a higher-level protocol.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */
 public interface ProtocolSession
 {
+	/**
+	 * Returns the {@link ProtocolHandler} which handles this session.
+	 */
     ProtocolHandler getHandler();
 
+    /**
+     * Returns the {@link ProtocolEncoder} for this session.
+     */
     ProtocolEncoder getEncoder();
 
+    /**
+     * Returns the {@link ProtocolDecoder} for this session.
+     */
     ProtocolDecoder getDecoder();
 
+    /**
+     * Closes the connection immediately.
+     */
     void close();
 
+    /**
+     * Returns an attachment of this session.
+     */
     Object getAttachment();
 
+    /**
+     * Sets an attachment of this session.
+     */
     void setAttachment( Object attachment );
 
-    boolean write( Object message );
-
-    boolean isStateless();
-
+    /**
+     * Writes the specified <code>message</code> to remote peer.  This operation
+     * is asynchronous; {@link ProtocolHandler#messageSent(ProtocolSession, Object)}
+     * will be invoked when the message is actually sent to remote peer.
+     */
+    void write( Object message );
+
+    /**
+     * Returns transport type of this session.
+     */
+    TransportType getTransportType();
+
+    /**
+     * Returns <code>true</code> if this session is connected with remote peer.
+     */
     boolean isConnected();
 
+    /**
+     * Returns the configuration of this session.
+     */
     SessionConfig getConfig();
 
+    /**
+     * Returns the socket address of remote peer. 
+     */
     SocketAddress getRemoteAddress();
 
+    /**
+     * Returns the socket address of local machine which is associated with this
+     * session.
+     */
     SocketAddress getLocalAddress();
 
+    /**
+     * Returns the total number of bytes which were read from this session.
+     */
+    long getReadBytes();
+
+    /**
+     * Returns the total number of bytes which were written to this session.
+     */
+    long getWrittenBytes();
+
+    /**
+     * Returns the time in millis when I/O occurred lastly.
+     */
     long getLastIoTime();
 
+    /**
+     * Returns the time in millis when read operation occurred lastly.
+     */
     long getLastReadTime();
 
+    /**
+     * Returns the time in millis when write operation occurred lastly.
+     */
     long getLastWriteTime();
 
+    /**
+     * Returns <code>true</code> if this session is idle for the specified 
+     * {@link IdleStatus}.
+     */
     boolean isIdle( IdleStatus status );
 }

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolViolationException.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolViolationException.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolViolationException.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolViolationException.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolViolationException.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolViolationException.java	Tue Dec 28 05:11:05 2004
@@ -22,8 +22,10 @@
 import org.apache.mina.util.ByteBuffers;
 
 /**
- * An exception that is thrown when {@link ProtocolEncoder} and {@link ProtocolDecoder}
- * cannot understand or validate incoming data.
+ * An exception that is thrown when {@link ProtocolEncoder} cannot understand or
+ * failed to validate the specified message, or when {@link ProtocolDecoder}
+ * cannot understand or failed to validate the specified {@link ByteBuffer}
+ * content.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
@@ -98,7 +100,7 @@
     /**
      * Sets unknown message part.
      */
-    public void setBuffer( ByteBuffer buffer )
+    void setBuffer( ByteBuffer buffer )
     {
         this.buffer = buffer;
     }

Added: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/filter/package.html
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/filter/package.html?view=auto&rev=123500
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/filter/package.html	Tue Dec 28 05:11:05 2004
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
+Basic <code>ProtocolHandlerFilter</code> implementations.
+</body>
+</html>

Added: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/package.html
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/package.html?view=auto&rev=123500
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/package.html	Tue Dec 28 05:11:05 2004
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
+High-level protocol implementation layer (Protocol layer).
+</body>
+</html>

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/Service.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/Service.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/Service.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/Service.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/Service.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/Service.java	Tue Dec 28 05:11:05 2004
@@ -18,8 +18,10 @@
  */
 package org.apache.mina.registry;
 
+import org.apache.mina.common.TransportType;
+
 /**
- * TODO Insert type comment.
+ * Represents a service that is registered to {@link ServiceRegistry}.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/ServiceRegistry.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/ServiceRegistry.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/ServiceRegistry.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/ServiceRegistry.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/ServiceRegistry.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/ServiceRegistry.java	Tue Dec 28 05:11:05 2004
@@ -21,10 +21,14 @@
 import java.io.IOException;
 import java.util.Iterator;
 
+import org.apache.mina.common.TransportType;
 import org.apache.mina.io.IoHandler;
+import org.apache.mina.io.IoHandlerFilter;
+import org.apache.mina.protocol.ProtocolHandler;
+import org.apache.mina.protocol.ProtocolHandlerFilter;
 
 /**
- * Interface for the internet service registry. The registry is used by Netty
+ * Interface for the internet service registry. The registry is used by MINA
  * to associate services with ports and transport protocols.
  * 
  * @author akarasulu@apache.org
@@ -35,7 +39,23 @@
 {
     void bind( Service service, IoHandler sessionHandler ) throws IOException;
 
+    void bind( Service service, ProtocolHandler sessionHandler )
+            throws IOException;
+
     void unbind( Service service );
+    
+    void addFilter( int priority, IoHandlerFilter filter );
+    
+    void addFilter( int priority, ProtocolHandlerFilter filter );
+    
+    void addFilter( Service service, int priority, IoHandlerFilter filter );
+
+    void addFilter( Service service, int priority,
+                   ProtocolHandlerFilter filter );
+    
+    void removeFilter( IoHandlerFilter filter );
+    
+    void removeFilter( ProtocolHandlerFilter filter );
 
     Service getByName( String name, TransportType transportType );
 

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/SimpleService.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/SimpleService.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/SimpleService.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/SimpleService.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/SimpleService.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/SimpleService.java	Tue Dec 28 05:11:05 2004
@@ -18,8 +18,10 @@
  */
 package org.apache.mina.registry;
 
+import org.apache.mina.common.TransportType;
+
 /**
- * TODO Document me.
+ * Default implementation of {@link Service}.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
@@ -33,6 +35,10 @@
 
     private final int port;
 
+    /**
+     * Creates a new instance with the specified protocol name, transport type,
+     * and port number.
+     */
     public SimpleService( String name, TransportType transportType, int port )
     {
         if( name == null )

Deleted: /incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/TransportType.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/TransportType.java?view=auto&rev=123499
==============================================================================

Added: incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/package.html
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/package.html?view=auto&rev=123500
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/registry/package.html	Tue Dec 28 05:11:05 2004
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
+This package is not yet implemented.
+</body>
+</html>

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/BasicSessionConfig.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/BasicSessionConfig.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/BasicSessionConfig.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/BasicSessionConfig.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/BasicSessionConfig.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/BasicSessionConfig.java	Tue Dec 28 05:11:05 2004
@@ -22,7 +22,7 @@
 import org.apache.mina.common.SessionConfig;
 
 /**
- * TODO Document me.
+ * Base class of all {@link SessionConfig}s.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/BlockingSet.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/BlockingSet.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/BlockingSet.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/BlockingSet.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/BlockingSet.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/BlockingSet.java	Tue Dec 28 05:11:05 2004
@@ -22,7 +22,7 @@
 import java.util.Iterator;
 
 /**
- * TODO Document me.
+ * A {@link HashSet} that can wait until it is not empty.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/ByteBuffers.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/ByteBuffers.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/ByteBuffers.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/ByteBuffers.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/ByteBuffers.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/ByteBuffers.java	Tue Dec 28 05:11:05 2004
@@ -21,6 +21,8 @@
 import org.apache.mina.common.ByteBuffer;
 
 /**
+ * Provides utility methods for ByteBuffers.
+ * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */

Deleted: /incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/DefaultExceptionMonitor.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/DefaultExceptionMonitor.java?view=auto&rev=123499
==============================================================================

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java	Tue Dec 28 05:11:05 2004
@@ -26,7 +26,7 @@
 import org.apache.mina.protocol.IoAdapter;
 
 /**
- * TODO Document me.
+ * Manages the list of {@link IoHandlerFilter}s.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/ProtocolHandlerFilterManager.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/ProtocolHandlerFilterManager.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/ProtocolHandlerFilterManager.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/ProtocolHandlerFilterManager.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/ProtocolHandlerFilterManager.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/ProtocolHandlerFilterManager.java	Tue Dec 28 05:11:05 2004
@@ -24,7 +24,7 @@
 import org.apache.mina.protocol.ProtocolSession;
 
 /**
- * TODO Document me.
+ * Manages the list of {@link ProtocolHandlerFilter}s.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Queue.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Queue.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Queue.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Queue.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Queue.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Queue.java	Tue Dec 28 05:11:05 2004
@@ -22,9 +22,7 @@
 import java.util.Arrays;
 
 /**
- * <p>
- * A simple queue class. This class is <b>NOT </b> thread-safe.
- * </p>
+ * A unbounded circular queue.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
@@ -46,8 +44,7 @@
     private int size = 0;
 
     /**
-     * Construct a new, empty <code>Queue</code> with the specified initial
-     * capacity.
+     * Construct a new, empty queue.
      */
     public Queue()
     {

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Stack.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Stack.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Stack.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Stack.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Stack.java	(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/Stack.java	Tue Dec 28 05:11:05 2004
@@ -22,9 +22,7 @@
 import java.util.Arrays;
 
 /**
- * <p>
- * A simple queue class. This class is <b>NOT </b> thread-safe.
- * </p>
+ * A unbounded stack.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
@@ -38,8 +36,7 @@
     private int size = 0;
 
     /**
-     * Construct a new, empty <code>Queue</code> with the specified initial
-     * capacity.
+     * Construct a new, empty stack.
      */
     public Stack()
     {
@@ -47,7 +44,7 @@
     }
 
     /**
-     * Clears this queue.
+     * Clears this stack.
      */
     public void clear()
     {
@@ -56,9 +53,9 @@
     }
 
     /**
-     * Dequeues from this queue.
+     * Pops from this stack.
      * 
-     * @return <code>null</code>, if this queue is empty or the element is
+     * @return <code>null</code>, if this stack is empty or the element is
      *         really <code>null</code>.
      */
     public Object pop()
@@ -77,7 +74,7 @@
     }
 
     /**
-     * Enqueue into this queue.
+     * Push into this stack.
      */
     public void push( Object obj )
     {
@@ -109,9 +106,9 @@
     }
 
     /**
-     * Returns the first element of the queue.
+     * Returns the first element of the stack.
      * 
-     * @return <code>null</code>, if the queue is empty, or the element is
+     * @return <code>null</code>, if the stack is empty, or the element is
      *         really <code>null</code>.
      */
     public Object first()
@@ -135,7 +132,7 @@
     }
 
     /**
-     * Returns <code>true</code> if the queue is empty.
+     * Returns <code>true</code> if the stack is empty.
      */
     public boolean isEmpty()
     {
@@ -143,7 +140,7 @@
     }
 
     /**
-     * Returns the number of elements in the queue.
+     * Returns the number of elements in the stack.
      */
     public int size()
     {

Added: incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/package.html
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/package.html?view=auto&rev=123500
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/package.html	Tue Dec 28 05:11:05 2004
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
+This package is used by MINA internally.
+</body>
+</html>

Modified: incubator/directory/network/trunk/mina/src/test/org/apache/mina/examples/echoserver/Test.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/test/org/apache/mina/examples/echoserver/Test.java?view=diff&rev=123500&p1=incubator/directory/network/trunk/mina/src/test/org/apache/mina/examples/echoserver/Test.java&r1=123499&p2=incubator/directory/network/trunk/mina/src/test/org/apache/mina/examples/echoserver/Test.java&r2=123500
==============================================================================
--- incubator/directory/network/trunk/mina/src/test/org/apache/mina/examples/echoserver/Test.java	(original)
+++ incubator/directory/network/trunk/mina/src/test/org/apache/mina/examples/echoserver/Test.java	Tue Dec 28 05:11:05 2004
@@ -17,7 +17,7 @@
 import org.apache.mina.io.socket.SocketAcceptor;
 
 /**
- * TODO Document me.
+ * Tests echo server example.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$

Mime
View raw message