directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r123159 - in incubator/directory/network/trunk/mina/src: examples/org/apache/mina/examples/echoserver examples/org/apache/mina/examples/netcat java/org/apache/mina/io java/org/apache/mina/io/filter java/org/apache/mina/io/socket java/org/apache/mina/protocol java/org/apache/mina/util
Date Thu, 23 Dec 2004 01:16:34 GMT
Author: trustin
Date: Wed Dec 22 17:16:33 2004
New Revision: 123159

URL: http://svn.apache.org/viewcvs?view=rev&rev=123159
Log:
 * Removed readBytes and writtenBytes parameter from IoHandler interface.
Modified:
   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/netcat/NetCatProtocolHandler.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/filter/BlacklistFilter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/TcpIoProcessor.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java

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=123159&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java&r1=123158&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/echoserver/EchoProtocolHandler.java&r2=123159
==============================================================================
--- 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
Wed Dec 22 17:16:33 2004
@@ -53,10 +53,9 @@
         cause.printStackTrace( System.out );
     }
 
-    public void dataRead( IoSession IoSession, int readBytes )
+    public void dataRead( IoSession IoSession )
     {
-        System.out.println( IoSession.getRemoteAddress() + ": READ ("
-                            + readBytes + "B)" );
+        System.out.println( IoSession.getRemoteAddress() + ": READ" );
 
         ReadBuffer rb = IoSession.getReadBuffer();
         WriteBuffer wb = IoSession.getWriteBuffer();
@@ -67,10 +66,9 @@
         }
     }
 
-    public void dataWritten( IoSession IoSession, int writtenBytes )
+    public void dataWritten( IoSession IoSession )
     {
-        System.out.println( IoSession.getRemoteAddress() + ": WRITTEN ("
-                            + writtenBytes + "B)" );
+        System.out.println( IoSession.getRemoteAddress() + ": WRITTEN");
 
         ReadBuffer rb = IoSession.getReadBuffer();
         WriteBuffer wb = IoSession.getWriteBuffer();

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=123159&p1=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java&r1=123158&p2=incubator/directory/network/trunk/mina/src/examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.java&r2=123159
==============================================================================
--- 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
Wed Dec 22 17:16:33 2004
@@ -19,7 +19,7 @@
 package org.apache.mina.examples.netcat;
 
 import org.apache.mina.common.IdleStatus;
-import org.apache.mina.io.IoHandler;
+import org.apache.mina.io.IoHandlerAdapter;
 import org.apache.mina.io.IoSession;
 import org.apache.mina.io.ReadBuffer;
 
@@ -29,7 +29,7 @@
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$,
  */
-public class NetCatProtocolHandler implements IoHandler
+public class NetCatProtocolHandler extends IoHandlerAdapter
 {
     public void sessionOpened( IoSession session )
     {
@@ -46,11 +46,7 @@
         session.close();
     }
 
-    public void exceptionCaught( IoSession session, Throwable cause )
-    {
-    }
-
-    public void dataRead( IoSession session, int readBytes )
+    public void dataRead( IoSession session )
     {
         ReadBuffer buf = session.getReadBuffer();
 
@@ -60,13 +56,5 @@
         }
         buf.signal();
         System.out.flush();
-    }
-
-    public void dataWritten( IoSession session, int writtenBytes )
-    {
-    }
-
-    public void markerReleased( IoSession session, Object marker )
-    {
     }
 }

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=123159&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandler.java&r1=123158&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandler.java&r2=123159
==============================================================================
--- 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	Wed
Dec 22 17:16:33 2004
@@ -36,9 +36,9 @@
 
     void exceptionCaught( IoSession session, Throwable cause );
 
-    void dataRead( IoSession session, int readBytes );
+    void dataRead( IoSession session );
 
-    void dataWritten( IoSession session, int writtenBytes );
+    void dataWritten( IoSession session );
 
     void markerReleased( IoSession session, Object marker );
 }

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=123159&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerAdapter.java&r1=123158&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerAdapter.java&r2=123159
==============================================================================
--- 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
Wed Dec 22 17:16:33 2004
@@ -30,11 +30,11 @@
     {
     }
 
-    public void dataRead( IoSession session, int readBytes )
+    public void dataRead( IoSession session )
     {
     }
 
-    public void dataWritten( IoSession session, int writtenBytes )
+    public void dataWritten( IoSession session )
     {
     }
 

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=123159&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java&r1=123158&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java&r2=123159
==============================================================================
--- 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
Wed Dec 22 17:16:33 2004
@@ -36,9 +36,9 @@
 
     void exceptionCaught( IoHandler nextHandler, IoSession session, Throwable cause );
 
-    void dataRead( IoHandler nextHandler, IoSession session, int readBytes );
+    void dataRead( IoHandler nextHandler, IoSession session );
 
-    void dataWritten( IoHandler nextHandler, IoSession session, int writtenBytes );
+    void dataWritten( IoHandler nextHandler, IoSession session );
 
     void markerReleased( IoHandler nextHandler, IoSession session, Object marker );
 }

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=123159&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java&r1=123158&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java&r2=123159
==============================================================================
--- 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
Wed Dec 22 17:16:33 2004
@@ -36,16 +36,14 @@
         nextHandler.exceptionCaught( session, cause );
     }
 
-    public void dataRead( IoHandler nextHandler, IoSession session,
-                         int readBytes )
+    public void dataRead( IoHandler nextHandler, IoSession session )
     {
-        nextHandler.dataRead( session, readBytes );
+        nextHandler.dataRead( session );
     }
 
-    public void dataWritten( IoHandler nextHandler, IoSession session,
-                            int writtenBytes )
+    public void dataWritten( IoHandler nextHandler, IoSession session )
     {
-        nextHandler.dataWritten( session, writtenBytes );
+        nextHandler.dataWritten( session );
     }
 
     public void markerReleased( IoHandler nextHandler, IoSession session,

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java?view=diff&rev=123159&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java&r1=123158&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java&r2=123159
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/filter/BlacklistFilter.java
Wed Dec 22 17:16:33 2004
@@ -34,8 +34,7 @@
         blacklist.remove( address );
     }
 
-    public void dataRead( IoHandler nextHandler, IoSession session,
-                         int readBytes )
+    public void dataRead( IoHandler nextHandler, IoSession session )
     {
         if( isBlocked( session ) )
         {
@@ -47,7 +46,7 @@
         else
         {
             // or forward
-            super.dataRead( nextHandler, session, readBytes );
+            super.dataRead( nextHandler, session );
         }
     }
 

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/TcpIoProcessor.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/TcpIoProcessor.java?view=diff&rev=123159&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/TcpIoProcessor.java&r1=123158&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/TcpIoProcessor.java&r2=123159
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/TcpIoProcessor.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/socket/TcpIoProcessor.java
Wed Dec 22 17:16:33 2004
@@ -288,8 +288,7 @@
                     if( readBytes > 0 )
                     {
                         lock.markBaseIndex();
-                        session.getFilterManager().fireDataRead( session,
-                                                                 readBytes );
+                        session.getFilterManager().fireDataRead( session );
                     }
                     else
                     {
@@ -462,8 +461,7 @@
                     {
                         session.increaseWrittenBytes( writtenBytes );
                         lock.markBaseIndex();
-                        session.getFilterManager()
-                                .fireDataWritten( session, writtenBytes );
+                        session.getFilterManager().fireDataWritten( session );
                         Queue markers = lock.getMarkers();
                         for( ;; )
                         {

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=123159&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java&r1=123158&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/IoAdapter.java&r2=123159
==============================================================================
--- 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
Wed Dec 22 17:16:33 2004
@@ -100,7 +100,7 @@
                     .getAttachment(), cause );
         }
 
-        public void dataRead( IoSession session, int readBytes )
+        public void dataRead( IoSession session )
         {
             ProtocolSession psession = ( ProtocolSession ) session
                     .getAttachment();
@@ -144,7 +144,7 @@
             }
         }
 
-        public void dataWritten( IoSession session, int writtenBytes )
+        public void dataWritten( IoSession session )
         {
             write( session );
         }

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=123159&p1=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java&r1=123158&p2=incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java&r2=123159
==============================================================================
--- 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
Wed Dec 22 17:16:33 2004
@@ -41,16 +41,14 @@
             session.getHandler().exceptionCaught( session, cause );
         }
 
-        public void dataRead( IoHandler nextHandler, IoSession session,
-                             int readBytes )
+        public void dataRead( IoHandler nextHandler, IoSession session )
         {
-            session.getHandler().dataRead( session, readBytes );
+            session.getHandler().dataRead( session );
         }
 
-        public void dataWritten( IoHandler nextHandler, IoSession session,
-                                int writtenBytes )
+        public void dataWritten( IoHandler nextHandler, IoSession session )
         {
-            session.getHandler().dataWritten( session, writtenBytes );
+            session.getHandler().dataWritten( session );
         }
 
         public void markerReleased( IoHandler nextHandler, IoSession session,
@@ -170,12 +168,12 @@
         }
     }
 
-    public void fireDataRead( IoSession session, int readBytes )
+    public void fireDataRead( IoSession session )
     {
         Entry head = this.head;
         try
         {
-            head.filter.dataRead( head.nextHandler, session, readBytes );
+            head.filter.dataRead( head.nextHandler, session );
         }
         catch( Throwable e )
         {
@@ -183,12 +181,12 @@
         }
     }
 
-    public void fireDataWritten( IoSession session, int dataWritten )
+    public void fireDataWritten( IoSession session )
     {
         Entry head = this.head;
         try
         {
-            head.filter.dataWritten( head.nextHandler, session, dataWritten );
+            head.filter.dataWritten( head.nextHandler, session );
         }
         catch( Throwable e )
         {
@@ -302,13 +300,13 @@
                     }
                 }
 
-                public void dataRead( IoSession session, int readBytes )
+                public void dataRead( IoSession session )
                 {
                     try
                     {
                         Entry.this.nextEntry.filter
                                 .dataRead( Entry.this.nextEntry.nextHandler,
-                                           session, readBytes );
+                                           session );
                     }
                     catch( Throwable e )
                     {
@@ -316,14 +314,14 @@
                     }
                 }
 
-                public void dataWritten( IoSession session, int writtenBytes )
+                public void dataWritten( IoSession session )
                 {
                     try
                     {
                         Entry.this.nextEntry.filter
                                 .dataWritten(
                                               Entry.this.nextEntry.nextHandler,
-                                              session, writtenBytes );
+                                              session );
                     }
                     catch( Throwable e )
                     {

Mime
View raw message