directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r165128 - in /directory/network/trunk/src: examples/org/apache/mina/examples/tennis/ java/org/apache/mina/io/ java/org/apache/mina/io/datagram/ java/org/apache/mina/io/socket/ java/org/apache/mina/protocol/ java/org/apache/mina/protocol/io/ java/org/apache/mina/protocol/vmpipe/ test/org/apache/mina/io/ test/org/apache/mina/protocol/ test/org/apache/mina/protocol/codec/
Date Thu, 28 Apr 2005 11:16:57 GMT
Author: trustin
Date: Thu Apr 28 04:16:55 2005
New Revision: 165128

URL: http://svn.apache.org/viewcvs?rev=165128&view=rev
Log:
* Fixed: in-VM pipe implementation is broken
* Added: IoSession and ProtocolSession interface
* Added: getFilterChain() to IoSession and ProtocolSession
* Added: IoSessionManager and ProtocolSessionManager
* Pulled up getFilterChain() from acceptors and connectors to IoSessionManager and ProtocolSessionManager
* Added: IoSessionFilterChain (used by transport type implementations)
* Added: IoSessionManagerFilterChain (used by transport type implementations)
* Added: ProtocolSessionFilterChain (used by transport type implementations)
* Added: ProtocolSessionManagerFilterChain (used by transport type implementations)

Added:
    directory/network/trunk/src/java/org/apache/mina/io/IoSessionFilterChain.java   (with props)
    directory/network/trunk/src/java/org/apache/mina/io/IoSessionManager.java   (with props)
    directory/network/trunk/src/java/org/apache/mina/io/IoSessionManagerFilterChain.java   (with props)
    directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSessionManager.java   (with props)
    directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSessionManagerFilterChain.java   (with props)
    directory/network/trunk/src/java/org/apache/mina/io/socket/SocketSessionManagerFilterChain.java   (with props)
    directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionFilterChain.java   (with props)
    directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionManager.java   (with props)
    directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionManagerFilterChain.java   (with props)
    directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolSessionManagerFilterChain.java   (with props)
    directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeSessionManagerFilterChain.java   (with props)
Removed:
    directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramFilterChain.java
    directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramProcessor.java
    directory/network/trunk/src/java/org/apache/mina/io/socket/SocketFilterChain.java
    directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolFilterChain.java
    directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeFilterChain.java
Modified:
    directory/network/trunk/src/examples/org/apache/mina/examples/tennis/TennisPlayer.java
    directory/network/trunk/src/java/org/apache/mina/io/IoAcceptor.java
    directory/network/trunk/src/java/org/apache/mina/io/IoConnector.java
    directory/network/trunk/src/java/org/apache/mina/io/IoSession.java
    directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java
    directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramConnector.java
    directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSession.java
    directory/network/trunk/src/java/org/apache/mina/io/socket/SocketAcceptor.java
    directory/network/trunk/src/java/org/apache/mina/io/socket/SocketConnector.java
    directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
    directory/network/trunk/src/java/org/apache/mina/io/socket/SocketSession.java
    directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolAcceptor.java
    directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolConnector.java
    directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSession.java
    directory/network/trunk/src/java/org/apache/mina/protocol/io/IoAdapter.java
    directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolAcceptor.java
    directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolConnector.java
    directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolSession.java
    directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeAcceptor.java
    directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeConnector.java
    directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeFilter.java
    directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeIdleStatusChecker.java
    directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeSession.java
    directory/network/trunk/src/test/org/apache/mina/io/IoHandlerFilterChainTest.java
    directory/network/trunk/src/test/org/apache/mina/protocol/ProtocolHandlerFilterChainTest.java
    directory/network/trunk/src/test/org/apache/mina/protocol/codec/CumulativeProtocolDecoderTest.java

Modified: directory/network/trunk/src/examples/org/apache/mina/examples/tennis/TennisPlayer.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/examples/org/apache/mina/examples/tennis/TennisPlayer.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/examples/org/apache/mina/examples/tennis/TennisPlayer.java (original)
+++ directory/network/trunk/src/examples/org/apache/mina/examples/tennis/TennisPlayer.java Thu Apr 28 04:16:55 2005
@@ -17,7 +17,7 @@
  */
 public class TennisPlayer implements ProtocolProvider
 {
-    private static final ProtocolHandler HANDLER = new TennisPlayerHandler();
+    private final ProtocolHandler HANDLER = new TennisPlayerHandler();
     
     public ProtocolCodecFactory getCodecFactory()
     {

Modified: directory/network/trunk/src/java/org/apache/mina/io/IoAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/IoAcceptor.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/IoAcceptor.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/io/IoAcceptor.java Thu Apr 28 04:16:55 2005
@@ -22,7 +22,6 @@
 import java.net.SocketAddress;
 
 import org.apache.mina.common.SessionInitializer;
-import org.apache.mina.common.SessionManager;
 
 /**
  * Accepts incoming connection, communicates with clients, and fires events to
@@ -39,16 +38,13 @@
  * Threads accept incoming connections start automatically when
  * {@link #bind(SocketAddress, IoHandler)} is invoked, and stop when all
  * addresses are unbound.
- * <p>
- * {@link IoHandlerFilter}s can be added and removed at any time to filter
- * events just like Servlet filters and they are effective immediately.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  * 
  * @see SessionInitializer
  */
-public interface IoAcceptor extends SessionManager
+public interface IoAcceptor extends IoSessionManager
 {
     /**
      * Binds to the specified <code>address</code> and handles incoming
@@ -70,6 +66,4 @@
      * Unbinds from the specified <code>address</code>.
      */
     void unbind( SocketAddress address );
-
-    IoHandlerFilterChain getFilterChain();
 }

Modified: directory/network/trunk/src/java/org/apache/mina/io/IoConnector.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/IoConnector.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/IoConnector.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/io/IoConnector.java Thu Apr 28 04:16:55 2005
@@ -22,7 +22,6 @@
 import java.net.SocketAddress;
 
 import org.apache.mina.common.SessionInitializer;
-import org.apache.mina.common.SessionManager;
 
 /**
  * Connects to endpoint, communicates with the server, and fires events to
@@ -39,16 +38,13 @@
  * Threads connect to endpoint start automatically when
  * {@link #connect(SocketAddress, IoHandler)} is invoked, and stop when all
  * connection attempts are finished.
- * <p>
- * {@link IoHandlerFilter}s can be added and removed at any time to filter
- * events just like Servlet filters and they are effective immediately.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  * 
  * @see SessionInitializer
  */
-public interface IoConnector extends SessionManager
+public interface IoConnector extends IoSessionManager
 {
     /**
      * Connects to the specified <code>address</code>.  If communication starts
@@ -134,6 +130,4 @@
     IoSession connect( SocketAddress address, SocketAddress localAddress,
                        int timeout, IoHandler handler,
                        SessionInitializer initializer ) throws IOException;
-
-    IoHandlerFilterChain getFilterChain();
 }

Modified: directory/network/trunk/src/java/org/apache/mina/io/IoSession.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/IoSession.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/IoSession.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/io/IoSession.java Thu Apr 28 04:16:55 2005
@@ -36,6 +36,11 @@
      * Returns the event handler for this session.
      */
     IoHandler getHandler();
+    
+    /**
+     * Returns the filter chain that only affects this session.
+     */
+    IoHandlerFilterChain getFilterChain();
 
     /**
      * Writes the content of the specified <code>buf</code>.

Added: directory/network/trunk/src/java/org/apache/mina/io/IoSessionFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/IoSessionFilterChain.java?rev=165128&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/IoSessionFilterChain.java (added)
+++ directory/network/trunk/src/java/org/apache/mina/io/IoSessionFilterChain.java Thu Apr 28 04:16:55 2005
@@ -0,0 +1,23 @@
+package org.apache.mina.io;
+
+import org.apache.mina.common.ByteBuffer;
+
+/**
+ * An {@link IoHandlerFilterChain} for datagram transport (UDP/IP).
+ * 
+ * @author The Apache Directory Project
+ */
+public class IoSessionFilterChain extends AbstractIoHandlerFilterChain {
+
+    private final IoSessionManagerFilterChain prevChain;
+
+    public IoSessionFilterChain( IoSessionManagerFilterChain prevChain )
+    {
+        this.prevChain = prevChain;
+    }
+
+    protected void doWrite( IoSession session, ByteBuffer buf, Object marker )
+    {
+        prevChain.filterWrite( session, buf, marker );
+    }
+}

Propchange: directory/network/trunk/src/java/org/apache/mina/io/IoSessionFilterChain.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Added: directory/network/trunk/src/java/org/apache/mina/io/IoSessionManager.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/IoSessionManager.java?rev=165128&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/IoSessionManager.java (added)
+++ directory/network/trunk/src/java/org/apache/mina/io/IoSessionManager.java Thu Apr 28 04:16:55 2005
@@ -0,0 +1,16 @@
+package org.apache.mina.io;
+
+import org.apache.mina.common.SessionManager;
+/**
+ * TODO document me
+ * 
+ * {@link IoHandlerFilter}s can be added and removed at any time to filter
+ * events just like Servlet filters and they are effective immediately.
+ * 
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface IoSessionManager extends SessionManager {
+    IoHandlerFilterChain getFilterChain();
+}

Propchange: directory/network/trunk/src/java/org/apache/mina/io/IoSessionManager.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Added: directory/network/trunk/src/java/org/apache/mina/io/IoSessionManagerFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/IoSessionManagerFilterChain.java?rev=165128&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/IoSessionManagerFilterChain.java (added)
+++ directory/network/trunk/src/java/org/apache/mina/io/IoSessionManagerFilterChain.java Thu Apr 28 04:16:55 2005
@@ -0,0 +1,70 @@
+package org.apache.mina.io;
+
+import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.IdleStatus;
+
+/**
+ * An {@link IoHandlerFilterChain} for datagram transport (UDP/IP).
+ * 
+ * @author The Apache Directory Project
+ */
+public abstract class IoSessionManagerFilterChain extends AbstractIoHandlerFilterChain {
+
+    private final IoSessionManager manager;
+
+    protected IoSessionManagerFilterChain( IoSessionManager manager )
+    {
+        this.manager = manager;
+    }
+    
+    public IoSessionManager getManager()
+    {
+        return manager;
+    }
+    
+    protected IoHandlerFilter createTailFilter()
+    {
+        return new IoHandlerFilter()
+        {
+            public void sessionOpened( NextFilter nextFilter, IoSession session )
+            {
+                ( ( IoSessionFilterChain ) session.getFilterChain() ).sessionOpened( session );
+            }
+
+            public void sessionClosed( NextFilter nextFilter, IoSession session )
+            {
+                ( ( IoSessionFilterChain ) session.getFilterChain() ).sessionClosed( session );
+            }
+
+            public void sessionIdle( NextFilter nextFilter, IoSession session,
+                                    IdleStatus status )
+            {
+                ( ( IoSessionFilterChain ) session.getFilterChain() ).sessionIdle( session, status );
+            }
+
+            public void exceptionCaught( NextFilter nextFilter,
+                                        IoSession session, Throwable cause )
+            {
+                ( ( IoSessionFilterChain ) session.getFilterChain() ).exceptionCaught( session, cause );
+            }
+
+            public void dataRead( NextFilter nextFilter, IoSession session,
+                                 ByteBuffer buf )
+            {
+                ( ( IoSessionFilterChain ) session.getFilterChain() ).dataRead( session, buf );
+            }
+
+            public void dataWritten( NextFilter nextFilter, IoSession session,
+                                    Object marker )
+            {
+                ( ( IoSessionFilterChain ) session.getFilterChain() ).dataWritten( session, marker );
+            }
+
+            public void filterWrite( NextFilter nextFilter,
+                                     IoSession session, ByteBuffer buf, Object marker )
+            {
+                nextFilter.filterWrite( session, buf, marker );
+            }
+        };
+    }
+}

Propchange: directory/network/trunk/src/java/org/apache/mina/io/IoSessionManagerFilterChain.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java Thu Apr 28 04:16:55 2005
@@ -34,6 +34,7 @@
 import org.apache.mina.io.IoAcceptor;
 import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoHandlerFilterChain;
+import org.apache.mina.io.IoSessionManagerFilterChain;
 import org.apache.mina.util.ExceptionUtil;
 import org.apache.mina.util.Queue;
 
@@ -43,11 +44,12 @@
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */
-public class DatagramAcceptor extends DatagramProcessor implements IoAcceptor
+public class DatagramAcceptor extends DatagramSessionManager implements IoAcceptor
 {
     private static volatile int nextId = 0;
 
-    private final DatagramFilterChain filters = new DatagramFilterChain( this );
+    private final IoSessionManagerFilterChain filters =
+        new DatagramSessionManagerFilterChain( this );
 
     private final int id = nextId ++ ;
 
@@ -339,7 +341,7 @@
             }
             catch( IOException e )
             {
-                session.getFilters().exceptionCaught( session, e );
+                session.getManagerFilterChain().exceptionCaught( session, e );
             }
         }
     }
@@ -379,10 +381,10 @@
                 }
                 catch( IllegalStateException e )
                 {
-                    session.getFilters().exceptionCaught( session, e );
+                    session.getManagerFilterChain().exceptionCaught( session, e );
                 }
 
-                session.getFilters().dataWritten( session, marker );
+                session.getManagerFilterChain().dataWritten( session, marker );
                 continue;
             }
 
@@ -408,7 +410,7 @@
                 }
 
                 session.increaseWrittenBytes( writtenBytes );
-                session.getFilters().dataWritten( session, marker );
+                session.getManagerFilterChain().dataWritten( session, marker );
             }
         }
     }

Modified: directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramConnector.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramConnector.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramConnector.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramConnector.java Thu Apr 28 04:16:55 2005
@@ -33,6 +33,7 @@
 import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoHandlerFilterChain;
 import org.apache.mina.io.IoSession;
+import org.apache.mina.io.IoSessionManagerFilterChain;
 import org.apache.mina.util.ExceptionUtil;
 import org.apache.mina.util.Queue;
 
@@ -42,11 +43,12 @@
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  */
-public class DatagramConnector extends DatagramProcessor implements IoConnector
+public class DatagramConnector extends DatagramSessionManager implements IoConnector
 {
     private static volatile int nextId = 0;
 
-    private final DatagramFilterChain filters = new DatagramFilterChain( this );
+    private final IoSessionManagerFilterChain filters =
+        new DatagramSessionManagerFilterChain( this );
 
     private final int id = nextId ++ ;
 
@@ -349,7 +351,7 @@
             }
             catch( IOException e )
             {
-                session.getFilters().exceptionCaught( session, e );
+                session.getManagerFilterChain().exceptionCaught( session, e );
             }
         }
     }
@@ -389,10 +391,10 @@
                 }
                 catch( IllegalStateException e )
                 {
-                    session.getFilters().exceptionCaught( session, e );
+                    session.getManagerFilterChain().exceptionCaught( session, e );
                 }
 
-                session.getFilters().dataWritten( session, marker );
+                session.getManagerFilterChain().dataWritten( session, marker );
                 continue;
             }
 
@@ -415,7 +417,7 @@
                     writeBufferQueue.pop();
                     writeMarkerQueue.pop();
                 }
-                session.getFilters().dataWritten( session, marker );
+                session.getManagerFilterChain().dataWritten( session, marker );
             }
         }
     }

Modified: directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSession.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSession.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSession.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSession.java Thu Apr 28 04:16:55 2005
@@ -27,7 +27,11 @@
 import org.apache.mina.common.SessionConfig;
 import org.apache.mina.common.TransportType;
 import org.apache.mina.io.IoHandler;
+import org.apache.mina.io.IoHandlerFilterChain;
 import org.apache.mina.io.IoSession;
+import org.apache.mina.io.IoSessionFilterChain;
+import org.apache.mina.io.IoSessionManager;
+import org.apache.mina.io.IoSessionManagerFilterChain;
 import org.apache.mina.util.Queue;
 
 /**
@@ -38,7 +42,9 @@
  */
 class DatagramSession extends BaseSession implements IoSession
 {
-    private final DatagramFilterChain filters;
+    private final IoSessionManagerFilterChain managerFilterChain;
+    
+    private final IoSessionFilterChain filterChain;
 
     private final DatagramChannel ch;
 
@@ -61,10 +67,11 @@
     /**
      * Creates a new instance.
      */
-    DatagramSession( DatagramFilterChain filters, DatagramChannel ch,
-                     IoHandler defaultHandler )
+    DatagramSession( IoSessionManagerFilterChain managerFilterChain,
+                     DatagramChannel ch, IoHandler defaultHandler )
     {
-        this.filters = filters;
+        this.managerFilterChain = managerFilterChain;
+        this.filterChain = new IoSessionFilterChain( managerFilterChain );
         this.ch = ch;
         this.config = new DatagramSessionConfig( ch );
         this.writeBufferQueue = new Queue();
@@ -74,9 +81,14 @@
         this.localAddress = ch.socket().getLocalSocketAddress();
     }
 
-    DatagramFilterChain getFilters()
+    IoSessionManagerFilterChain getManagerFilterChain()
+    {
+        return managerFilterChain;
+    }
+    
+    public IoHandlerFilterChain getFilterChain()
     {
-        return filters;
+        return filterChain;
     }
 
     DatagramChannel getChannel()
@@ -115,9 +127,10 @@
             return;
         }
 
-        if( filters.processor instanceof DatagramConnector )
+        IoSessionManager manager = managerFilterChain.getManager();
+        if( manager instanceof DatagramConnector )
         {
-            filters.processor.closeSession( this );
+            ( ( DatagramConnector ) manager ).closeSession( this );
             if( wait )
             {
                 while( disposed )
@@ -146,7 +159,7 @@
 
     public void write( ByteBuffer buf, Object marker )
     {
-        filters.filterWrite( this, buf, marker );
+        filterChain.filterWrite( this, buf, marker );
     }
 
     public TransportType getTransportType()

Added: directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSessionManager.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSessionManager.java?rev=165128&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSessionManager.java (added)
+++ directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSessionManager.java Thu Apr 28 04:16:55 2005
@@ -0,0 +1,45 @@
+/*
+ *   @(#) $Id$
+ *
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.mina.io.datagram;
+
+import org.apache.mina.common.BaseSessionManager;
+import org.apache.mina.io.IoSessionManager;
+
+/**
+ * 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$
+ */
+abstract class DatagramSessionManager extends BaseSessionManager implements IoSessionManager
+{
+    /**
+     * Requests this processor to flush the write buffer of the specified
+     * session.  This method is invoked by MINA internally.
+     */
+    abstract void flushSession( DatagramSession session );
+
+    /**
+     * Requests this processor to close the specified session.
+     * This method is invoked by MINA internally.
+     */
+    abstract void closeSession( DatagramSession session );
+}
\ No newline at end of file

Propchange: directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSessionManager.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Added: directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSessionManagerFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSessionManagerFilterChain.java?rev=165128&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSessionManagerFilterChain.java (added)
+++ directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSessionManagerFilterChain.java Thu Apr 28 04:16:55 2005
@@ -0,0 +1,35 @@
+package org.apache.mina.io.datagram;
+
+import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.io.IoHandlerFilterChain;
+import org.apache.mina.io.IoSession;
+import org.apache.mina.io.IoSessionManagerFilterChain;
+import org.apache.mina.util.Queue;
+
+/**
+ * An {@link IoHandlerFilterChain} for datagram transport (UDP/IP).
+ * 
+ * @author The Apache Directory Project
+ */
+class DatagramSessionManagerFilterChain extends IoSessionManagerFilterChain {
+
+    DatagramSessionManagerFilterChain( DatagramSessionManager processor )
+    {
+        super( processor );
+    }
+    
+    protected void doWrite( IoSession session, ByteBuffer buf, Object marker )
+    {
+        DatagramSession s = ( DatagramSession ) session;
+        Queue writeBufferQueue = s.getWriteBufferQueue();
+        Queue writeMarkerQueue = s.getWriteMarkerQueue();
+        
+        synchronized( writeBufferQueue )
+        {
+            writeBufferQueue.push( buf );
+            writeMarkerQueue.push( marker );
+        }
+
+        ( ( DatagramSessionManager ) getManager() ).flushSession( s );
+    }
+}

Propchange: directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramSessionManagerFilterChain.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/network/trunk/src/java/org/apache/mina/io/socket/SocketAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/socket/SocketAcceptor.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/socket/SocketAcceptor.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/io/socket/SocketAcceptor.java Thu Apr 28 04:16:55 2005
@@ -35,6 +35,7 @@
 import org.apache.mina.io.IoAcceptor;
 import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoHandlerFilterChain;
+import org.apache.mina.io.IoSessionManagerFilterChain;
 import org.apache.mina.util.Queue;
 
 /**
@@ -47,7 +48,7 @@
 {
     private static volatile int nextId = 0;
 
-    private final SocketFilterChain filters = new SocketFilterChain();
+    private final IoSessionManagerFilterChain filters = new SocketSessionManagerFilterChain( this );
 
     private final int id = nextId ++ ;
 

Modified: directory/network/trunk/src/java/org/apache/mina/io/socket/SocketConnector.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/socket/SocketConnector.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/socket/SocketConnector.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/io/socket/SocketConnector.java Thu Apr 28 04:16:55 2005
@@ -34,6 +34,7 @@
 import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoHandlerFilterChain;
 import org.apache.mina.io.IoSession;
+import org.apache.mina.io.IoSessionManagerFilterChain;
 import org.apache.mina.util.Queue;
 
 /**
@@ -48,7 +49,7 @@
 
     private final int id = nextId++;
 
-    private final SocketFilterChain filters = new SocketFilterChain();
+    private final IoSessionManagerFilterChain filters = new SocketSessionManagerFilterChain( this );
 
     private final Selector selector;
 

Modified: directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java Thu Apr 28 04:16:55 2005
@@ -161,12 +161,12 @@
             catch( IOException e )
             {
                 registered = false;
-                session.getFilters().exceptionCaught( session, e );
+                session.getManagerFilterChain().exceptionCaught( session, e );
             }
 
             if( registered )
             {
-                session.getFilters().sessionOpened( session );
+                session.getManagerFilterChain().sessionOpened( session );
             }
         }
     }
@@ -202,13 +202,13 @@
             }
             catch( IOException e )
             {
-                session.getFilters().exceptionCaught( session, e );
+                session.getManagerFilterChain().exceptionCaught( session, e );
             }
             finally
             {
                 releaseWriteBuffers( session );
 
-                session.getFilters().sessionClosed( session );
+                session.getManagerFilterChain().sessionClosed( session );
                 session.notifyClose();
             }
         }
@@ -271,7 +271,7 @@
                 ByteBuffer newBuf = ByteBuffer.allocate( readBytes );
                 newBuf.put( buf );
                 newBuf.flip();
-                session.getFilters().dataRead( session, newBuf );
+                session.getManagerFilterChain().dataRead( session, newBuf );
             }
             if( ret < 0 )
             {
@@ -282,7 +282,7 @@
         {
             if( e instanceof IOException )
                 scheduleRemove( session );
-            session.getFilters().exceptionCaught( session, e );
+            session.getManagerFilterChain().exceptionCaught( session, e );
         }
         finally
         {
@@ -356,7 +356,7 @@
             && ( currentTime - lastIoTime ) >= idleTime )
         {
             session.setIdle( status, true );
-            session.getFilters().sessionIdle( session, status );
+            session.getManagerFilterChain().sessionIdle( session, status );
         }
     }
 
@@ -369,7 +369,7 @@
             && ( session.getSelectionKey().interestOps() & SelectionKey.OP_WRITE ) != 0 )
         {
             session
-                    .getFilters()
+                    .getManagerFilterChain()
                     .exceptionCaught( session, new WriteTimeoutException() );
         }
     }
@@ -404,7 +404,7 @@
             catch( IOException e )
             {
                 scheduleRemove( session );
-                session.getFilters().exceptionCaught( session, e );
+                session.getManagerFilterChain().exceptionCaught( session, e );
             }
         }
     }
@@ -423,7 +423,7 @@
             }
             catch( IllegalStateException e )
             {
-                session.getFilters().exceptionCaught( session, e );
+                session.getManagerFilterChain().exceptionCaught( session, e );
             }
         }
     }
@@ -461,10 +461,10 @@
                 }
                 catch( IllegalStateException e )
                 {
-                    session.getFilters().exceptionCaught( session, e );
+                    session.getManagerFilterChain().exceptionCaught( session, e );
                 }
 
-                session.getFilters().dataWritten( session, marker );
+                session.getManagerFilterChain().dataWritten( session, marker );
                 continue;
             }
 

Modified: directory/network/trunk/src/java/org/apache/mina/io/socket/SocketSession.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/socket/SocketSession.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/socket/SocketSession.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/io/socket/SocketSession.java Thu Apr 28 04:16:55 2005
@@ -27,7 +27,10 @@
 import org.apache.mina.common.SessionConfig;
 import org.apache.mina.common.TransportType;
 import org.apache.mina.io.IoHandler;
+import org.apache.mina.io.IoHandlerFilterChain;
 import org.apache.mina.io.IoSession;
+import org.apache.mina.io.IoSessionFilterChain;
+import org.apache.mina.io.IoSessionManagerFilterChain;
 import org.apache.mina.util.Queue;
 
 /**
@@ -38,7 +41,9 @@
  */
 class SocketSession extends BaseSession implements IoSession
 {
-    private final SocketFilterChain filters;
+    private final IoSessionManagerFilterChain managerFilterChain;
+    
+    private final IoSessionFilterChain filterChain;
 
     private final SocketChannel ch;
 
@@ -61,10 +66,11 @@
     /**
      * Creates a new instance.
      */
-    SocketSession( SocketFilterChain filters, SocketChannel ch,
-                   IoHandler defaultHandler )
+    SocketSession( IoSessionManagerFilterChain managerFilterChain,
+                   SocketChannel ch, IoHandler defaultHandler )
     {
-        this.filters = filters;
+        this.managerFilterChain = managerFilterChain;
+        this.filterChain = new IoSessionFilterChain( managerFilterChain );
         this.ch = ch;
         this.config = new SocketSessionConfig( this );
         this.writeBufferQueue = new Queue();
@@ -74,9 +80,14 @@
         this.localAddress = ch.socket().getLocalSocketAddress();
     }
     
-    SocketFilterChain getFilters()
+    IoSessionManagerFilterChain getManagerFilterChain()
+    {
+        return managerFilterChain;
+    }
+    
+    public IoHandlerFilterChain getFilterChain()
     {
-        return filters;
+        return filterChain;
     }
 
     SocketChannel getChannel()
@@ -144,7 +155,7 @@
 
     public void write( ByteBuffer buf, Object marker )
     {
-        filters.filterWrite( this, buf, marker );
+        filterChain.filterWrite( this, buf, marker );
     }
 
     public TransportType getTransportType()

Added: directory/network/trunk/src/java/org/apache/mina/io/socket/SocketSessionManagerFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/socket/SocketSessionManagerFilterChain.java?rev=165128&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/socket/SocketSessionManagerFilterChain.java (added)
+++ directory/network/trunk/src/java/org/apache/mina/io/socket/SocketSessionManagerFilterChain.java Thu Apr 28 04:16:55 2005
@@ -0,0 +1,36 @@
+package org.apache.mina.io.socket;
+
+import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.io.IoHandlerFilterChain;
+import org.apache.mina.io.IoSession;
+import org.apache.mina.io.IoSessionManager;
+import org.apache.mina.io.IoSessionManagerFilterChain;
+import org.apache.mina.util.Queue;
+
+/**
+ * An {@link IoHandlerFilterChain} for socket transport (TCP/IP).
+ * 
+ * @author The Apache Directory Project
+ */
+class SocketSessionManagerFilterChain extends IoSessionManagerFilterChain {
+
+    SocketSessionManagerFilterChain( IoSessionManager manager )
+    {
+        super( manager );
+    }
+
+    protected void doWrite( IoSession session, ByteBuffer buf, Object marker )
+    {
+        SocketSession s = ( SocketSession ) session;
+        Queue writeBufferQueue = s.getWriteBufferQueue();
+        Queue writeMarkerQueue = s.getWriteMarkerQueue();
+        
+        synchronized( writeBufferQueue )
+        {
+            writeBufferQueue.push( buf );
+            writeMarkerQueue.push( marker );
+        }
+
+        SocketIoProcessor.getInstance().flushSession( s );
+    }
+}

Propchange: directory/network/trunk/src/java/org/apache/mina/io/socket/SocketSessionManagerFilterChain.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolAcceptor.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolAcceptor.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolAcceptor.java Thu Apr 28 04:16:55 2005
@@ -22,7 +22,6 @@
 import java.net.SocketAddress;
 
 import org.apache.mina.common.SessionInitializer;
-import org.apache.mina.common.SessionManager;
 
 /**
  * Accepts incoming connection, communicates with clients, and fires events to
@@ -39,16 +38,13 @@
  * Threads accept incoming connections start automatically when
  * {@link #bind(SocketAddress, ProtocolProvider)} is invoked, and stop when all
  * addresses are unbound.
- * <p>
- * {@link ProtocolHandlerFilter}s can be added and removed at any time to filter
- * events just like Servlet filters and they are effective immediately.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  * 
  * @see SessionInitializer
  */
-public interface ProtocolAcceptor extends SessionManager
+public interface ProtocolAcceptor extends ProtocolSessionManager
 {
     /**
      * Binds to the specified <code>address</code> and handles incoming
@@ -72,6 +68,4 @@
      * Unbinds from the specified <code>address</code>.
      */
     void unbind( SocketAddress address );
-
-    ProtocolHandlerFilterChain getFilterChain();
 }

Modified: directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolConnector.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolConnector.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolConnector.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolConnector.java Thu Apr 28 04:16:55 2005
@@ -22,7 +22,6 @@
 import java.net.SocketAddress;
 
 import org.apache.mina.common.SessionInitializer;
-import org.apache.mina.common.SessionManager;
 
 /**
  * Connects to endpoint, communicates with the server, and fires events to
@@ -39,16 +38,13 @@
  * Threads connect to endpoint start automatically when
  * {@link #connect(SocketAddress, ProtocolProvider)} is invoked, and stop when
  * all connection attempts are finished.
- * <p>
- * {@link ProtocolHandlerFilter}s can be added and removed at any time to filter
- * events just like Servlet filters and they are effective immediately.
  * 
  * @author Trustin Lee (trustin@apache.org)
  * @version $Rev$, $Date$
  * 
  * @see SessionInitializer
  */
-public interface ProtocolConnector extends SessionManager
+public interface ProtocolConnector extends ProtocolSessionManager
 {
     /**
      * Connects to the specified <code>address</code>.  If communication starts
@@ -137,6 +133,4 @@
     ProtocolSession connect( SocketAddress address, SocketAddress localAddress,
                              int timeout, ProtocolProvider protocolProvider,
                              SessionInitializer initializer ) throws IOException;
-
-    ProtocolHandlerFilterChain getFilterChain();
 }

Modified: directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSession.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSession.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSession.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSession.java Thu Apr 28 04:16:55 2005
@@ -37,6 +37,12 @@
     ProtocolHandler getHandler();
 
     /**
+     * Returns the filter chain that only affects this session.
+     */
+    ProtocolHandlerFilterChain getFilterChain();
+
+
+    /**
      * Returns the {@link ProtocolEncoder} for this session.
      */
     ProtocolEncoder getEncoder();

Added: directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionFilterChain.java?rev=165128&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionFilterChain.java (added)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionFilterChain.java Thu Apr 28 04:16:55 2005
@@ -0,0 +1,19 @@
+package org.apache.mina.protocol;
+
+/**
+ * TODO document me
+ */
+public class ProtocolSessionFilterChain extends AbstractProtocolHandlerFilterChain {
+
+    private final ProtocolSessionManagerFilterChain prevChain;
+
+    public ProtocolSessionFilterChain( ProtocolSessionManagerFilterChain prevChain )
+    {
+        this.prevChain = prevChain;
+    }
+
+    protected void doWrite( ProtocolSession session, Object message )
+    {
+        prevChain.filterWrite( session, message );
+    }
+}

Propchange: directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionFilterChain.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Added: directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionManager.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionManager.java?rev=165128&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionManager.java (added)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionManager.java Thu Apr 28 04:16:55 2005
@@ -0,0 +1,18 @@
+package org.apache.mina.protocol;
+
+import org.apache.mina.common.SessionManager;
+
+/**
+ * TODO document me.
+ * <p>
+ * {@link ProtocolHandlerFilter}s can be added and removed at any time to filter
+ * events just like Servlet filters and they are effective immediately.
+ *
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ *
+ */
+public interface ProtocolSessionManager extends SessionManager {
+    ProtocolHandlerFilterChain getFilterChain();
+}

Propchange: directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionManager.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Added: directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionManagerFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionManagerFilterChain.java?rev=165128&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionManagerFilterChain.java (added)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionManagerFilterChain.java Thu Apr 28 04:16:55 2005
@@ -0,0 +1,69 @@
+package org.apache.mina.protocol;
+
+import org.apache.mina.common.IdleStatus;
+
+/**
+ * TODO document me
+ * 
+ * @author The Apache Directory Project
+ */
+public abstract class ProtocolSessionManagerFilterChain extends AbstractProtocolHandlerFilterChain {
+
+    private final ProtocolSessionManager manager;
+
+    protected ProtocolSessionManagerFilterChain( ProtocolSessionManager manager )
+    {
+        this.manager = manager;
+    }
+    
+    public ProtocolSessionManager getManager()
+    {
+        return manager;
+    }
+    
+    protected ProtocolHandlerFilter createTailFilter()
+    {
+        return new ProtocolHandlerFilter()
+        {
+            public void sessionOpened( NextFilter nextFilter, ProtocolSession session )
+            {
+                ( ( ProtocolSessionFilterChain ) session.getFilterChain() ).sessionOpened( session );
+            }
+
+            public void sessionClosed( NextFilter nextFilter, ProtocolSession session )
+            {
+                ( ( ProtocolSessionFilterChain ) session.getFilterChain() ).sessionClosed( session );
+            }
+
+            public void sessionIdle( NextFilter nextFilter, ProtocolSession session,
+                                    IdleStatus status )
+            {
+                ( ( ProtocolSessionFilterChain ) session.getFilterChain() ).sessionIdle( session, status );
+            }
+
+            public void exceptionCaught( NextFilter nextFilter,
+                                        ProtocolSession session, Throwable cause )
+            {
+                ( ( ProtocolSessionFilterChain ) session.getFilterChain() ).exceptionCaught( session, cause );
+            }
+
+            public void messageReceived( NextFilter nextFilter, ProtocolSession session,
+                                         Object message )
+            {
+                ( ( ProtocolSessionFilterChain ) session.getFilterChain() ).messageReceived( session, message );
+            }
+
+            public void messageSent( NextFilter nextFilter, ProtocolSession session,
+                                     Object message )
+            {
+                ( ( ProtocolSessionFilterChain ) session.getFilterChain() ).messageSent( session, message );
+            }
+
+            public void filterWrite( NextFilter nextFilter,
+                                     ProtocolSession session, Object message )
+            {
+                nextFilter.filterWrite( session, message );
+            }
+        };
+    }
+}

Propchange: directory/network/trunk/src/java/org/apache/mina/protocol/ProtocolSessionManagerFilterChain.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/network/trunk/src/java/org/apache/mina/protocol/io/IoAdapter.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/io/IoAdapter.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/io/IoAdapter.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/io/IoAdapter.java Thu Apr 28 04:16:55 2005
@@ -49,15 +49,16 @@
 {
     private static final String KEY = "IoAdapter.ProtocolSession";
 
-    final IoProtocolFilterChain filters = new IoProtocolFilterChain();
+    private final IoProtocolSessionManagerFilterChain managerFilterChain;
 
-    IoAdapter()
+    IoAdapter( IoProtocolSessionManagerFilterChain filters )
     {
+        this.managerFilterChain = filters;
     }
     
     public ProtocolHandlerFilterChain getFilterChain()
     {
-        return filters;
+        return managerFilterChain;
     }
 
     /**
@@ -101,22 +102,22 @@
 
         public void sessionOpened( IoSession session )
         {
-            filters.sessionOpened( getProtocolSession( session ) );
+            managerFilterChain.sessionOpened( getProtocolSession( session ) );
         }
 
         public void sessionClosed( IoSession session )
         {
-            filters.sessionClosed( getProtocolSession( session ) );
+            managerFilterChain.sessionClosed( getProtocolSession( session ) );
         }
 
         public void sessionIdle( IoSession session, IdleStatus status )
         {
-            filters.sessionIdle( getProtocolSession( session ), status );
+            managerFilterChain.sessionIdle( getProtocolSession( session ), status );
         }
 
         public void exceptionCaught( IoSession session, Throwable cause )
         {
-            filters.exceptionCaught( getProtocolSession( session ), cause );
+            managerFilterChain.exceptionCaught( getProtocolSession( session ), cause );
         }
 
         public void dataRead( IoSession session, ByteBuffer in )
@@ -137,7 +138,7 @@
                     {
                         do
                         {
-                            filters.messageReceived( psession, queue.pop() );
+                            managerFilterChain.messageReceived( psession, queue.pop() );
                         }
                         while( !queue.isEmpty() );
                     }
@@ -146,11 +147,11 @@
             catch( ProtocolViolationException pve )
             {
                 pve.setBuffer( in );
-                filters.exceptionCaught( psession, pve );
+                managerFilterChain.exceptionCaught( psession, pve );
             }
             catch( Throwable t )
             {
-                filters.exceptionCaught( psession, t );
+                managerFilterChain.exceptionCaught( psession, t );
             }
         }
 
@@ -158,7 +159,7 @@
         {
             if( marker == null )
                 return;
-            filters.messageSent( getProtocolSession( session ),
+            managerFilterChain.messageSent( getProtocolSession( session ),
                                  marker );
         }
 
@@ -199,7 +200,7 @@
             }
             catch( Throwable t )
             {
-                filters.exceptionCaught( psession, t );
+                managerFilterChain.exceptionCaught( psession, t );
             }
         }
 
@@ -215,7 +216,8 @@
                         ( IoProtocolSession ) session.getAttribute( KEY );
                     if( psession == null )
                     {
-                        psession = new IoProtocolSession( IoAdapter.this, session, this );
+                        psession = new IoProtocolSession(
+                                IoAdapter.this.managerFilterChain, session, this );
                         session.setAttribute( KEY, psession );
                     }
                 }

Modified: directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolAcceptor.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolAcceptor.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolAcceptor.java Thu Apr 28 04:16:55 2005
@@ -29,7 +29,7 @@
 {
     private final IoAcceptor acceptor;
 
-    private final IoAdapter adapter = new IoAdapter();
+    private final IoAdapter adapter = new IoAdapter( new IoProtocolSessionManagerFilterChain( this ) );
 
     /**
      * Creates a new instance with the specified {@link IoAcceptor}.

Modified: directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolConnector.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolConnector.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolConnector.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolConnector.java Thu Apr 28 04:16:55 2005
@@ -29,7 +29,7 @@
 {
     private final IoConnector connector;
 
-    private final IoAdapter adapter = new IoAdapter();
+    private final IoAdapter adapter = new IoAdapter( new IoProtocolSessionManagerFilterChain( this ) );
 
     /**
      * Creates a new instance with the specified {@link IoConnector}.

Modified: directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolSession.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolSession.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolSession.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolSession.java Thu Apr 28 04:16:55 2005
@@ -13,7 +13,10 @@
 import org.apache.mina.protocol.ProtocolDecoder;
 import org.apache.mina.protocol.ProtocolEncoder;
 import org.apache.mina.protocol.ProtocolHandler;
+import org.apache.mina.protocol.ProtocolHandlerFilterChain;
 import org.apache.mina.protocol.ProtocolSession;
+import org.apache.mina.protocol.ProtocolSessionFilterChain;
+import org.apache.mina.protocol.ProtocolSessionManagerFilterChain;
 import org.apache.mina.protocol.SimpleProtocolDecoderOutput;
 import org.apache.mina.protocol.SimpleProtocolEncoderOutput;
 import org.apache.mina.protocol.io.IoAdapter.SessionHandlerAdapter;
@@ -27,7 +30,7 @@
  */
 public class IoProtocolSession implements ProtocolSession
 {
-    private final IoAdapter ioAdapter;
+    private final ProtocolSessionFilterChain filterChain;
 
     final IoSession session;
 
@@ -43,10 +46,10 @@
 
     final SimpleProtocolDecoderOutput decOut;
 
-    IoProtocolSession( IoAdapter ioAdapter, IoSession session,
-                       SessionHandlerAdapter shAdapter )
+    IoProtocolSession( ProtocolSessionManagerFilterChain managerFilterChain,
+                       IoSession session, SessionHandlerAdapter shAdapter )
     {
-        this.ioAdapter = ioAdapter;
+        this.filterChain = new ProtocolSessionFilterChain( managerFilterChain );
         this.session = session;
         this.shAdapter = shAdapter;
         this.encoder = shAdapter.codecFactory.newEncoder();
@@ -62,6 +65,11 @@
     {
         return session;   
     }
+    
+    public ProtocolHandlerFilterChain getFilterChain()
+    {
+        return filterChain;
+    }
 
     public ProtocolHandler getHandler()
     {
@@ -120,7 +128,7 @@
 
     public void write( Object message )
     {
-        this.ioAdapter.filters.filterWrite( this, message );
+        filterChain.filterWrite( this, message );
     }
 
     public TransportType getTransportType()

Added: directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolSessionManagerFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolSessionManagerFilterChain.java?rev=165128&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolSessionManagerFilterChain.java (added)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolSessionManagerFilterChain.java Thu Apr 28 04:16:55 2005
@@ -0,0 +1,26 @@
+package org.apache.mina.protocol.io;
+
+import org.apache.mina.protocol.ProtocolSession;
+import org.apache.mina.protocol.ProtocolSessionManager;
+import org.apache.mina.protocol.ProtocolSessionManagerFilterChain;
+import org.apache.mina.util.Queue;
+
+class IoProtocolSessionManagerFilterChain extends ProtocolSessionManagerFilterChain {
+
+    IoProtocolSessionManagerFilterChain( ProtocolSessionManager manager )
+    {
+        super( manager );
+    }
+
+    protected void doWrite( ProtocolSession session, Object message )
+    {
+        IoProtocolSession s = ( IoProtocolSession ) session;
+        Queue writeQueue = s.writeQueue;
+        synchronized( writeQueue )
+        {
+            writeQueue.push( message );
+        }
+
+        s.shAdapter.doWrite( s.session );
+    }
+}

Propchange: directory/network/trunk/src/java/org/apache/mina/protocol/io/IoProtocolSessionManagerFilterChain.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeAcceptor.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeAcceptor.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeAcceptor.java Thu Apr 28 04:16:55 2005
@@ -26,14 +26,15 @@
 {
     static final Map boundHandlers = new HashMap();
 
-    private final VmPipeFilterChain filters = new VmPipeFilterChain();
+    private final VmPipeSessionManagerFilterChain filterChain =
+        new VmPipeSessionManagerFilterChain( this );
 
     /**
      * Creates a new instance.
      */
     public VmPipeAcceptor()
     {
-        filters.addLast( "VMPipe", new VmPipeFilter() );
+        filterChain.addFirst( "VMPipe", new VmPipeFilter() );
     }
     
     public void bind( SocketAddress address, ProtocolProvider protocolProvider ) throws IOException
@@ -66,7 +67,7 @@
             boundHandlers.put( address, 
                                new Entry( this,
                                           ( VmPipeAddress ) address,
-                                          filters,
+                                          filterChain,
                                           protocolProvider.getHandler(),
                                           initializer ) );
         }
@@ -85,7 +86,7 @@
     
     public ProtocolHandlerFilterChain getFilterChain()
     {
-        return filters;
+        return filterChain;
     }
 
     static class Entry
@@ -94,7 +95,7 @@
         
         final VmPipeAddress address;
 
-        final VmPipeFilterChain filters;
+        final VmPipeSessionManagerFilterChain managerFilterChain;
 
         final ProtocolHandler handler;
         
@@ -102,13 +103,13 @@
 
         private Entry( VmPipeAcceptor acceptor,
                        VmPipeAddress address,
-                       VmPipeFilterChain filters,
+                       VmPipeSessionManagerFilterChain managerFilterChain,
                        ProtocolHandler handler,
                        SessionInitializer initializer )
         {
             this.acceptor = acceptor;
             this.address = address;
-            this.filters = filters;
+            this.managerFilterChain = managerFilterChain;
             this.handler = handler;
             this.initializer = initializer;
         }

Modified: directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeConnector.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeConnector.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeConnector.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeConnector.java Thu Apr 28 04:16:55 2005
@@ -23,19 +23,20 @@
  */
 public class VmPipeConnector extends BaseSessionManager implements ProtocolConnector
 {
-    private final VmPipeFilterChain filters = new VmPipeFilterChain();
+    private final VmPipeSessionManagerFilterChain filterChain =
+        new VmPipeSessionManagerFilterChain( this );
 
     /**
      * Creates a new instance.
      */
     public VmPipeConnector()
     {
-        filters.addLast( "VMPipe", new VmPipeFilter() );
+        filterChain.addFirst( "VMPipe", new VmPipeFilter() );
     }
     
     public ProtocolHandlerFilterChain getFilterChain()
     {
-        return filters;
+        return filterChain;
     }
 
     public ProtocolSession connect( SocketAddress address, ProtocolProvider protocolProvider ) throws IOException 
@@ -70,13 +71,6 @@
 
     public ProtocolSession connect( SocketAddress address, SocketAddress localAddress, int timeout, ProtocolProvider protocolProvider, SessionInitializer initializer ) throws IOException
     {
-        return connect( address, localAddress, timeout, protocolProvider, initializer );
-    }
-
-    public ProtocolSession connect( SocketAddress address,
-                                    ProtocolProvider protocolProvider,
-                                    SessionInitializer initializer ) throws IOException
-    {
         if( address == null )
             throw new NullPointerException( "address" );
         if( protocolProvider == null )
@@ -96,12 +90,19 @@
 
         VmPipeSession session = new VmPipeSession( new Object(), // lock
                                                    AnonymousVmPipeAddress.INSTANCE,
-                                                   filters,
+                                                   filterChain,
                                                    protocolProvider.getHandler(),
                                                    initializer,
                                                    entry );
 
         VmPipeIdleStatusChecker.INSTANCE.addSession( session );
         return session;
+    }
+
+    public ProtocolSession connect( SocketAddress address,
+                                    ProtocolProvider protocolProvider,
+                                    SessionInitializer initializer ) throws IOException
+    {
+        return connect( address, null, Integer.MAX_VALUE, protocolProvider, initializer);
     }
 }

Modified: directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeFilter.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeFilter.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeFilter.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeFilter.java Thu Apr 28 04:16:55 2005
@@ -16,20 +16,20 @@
  */
 class VmPipeFilter extends ProtocolHandlerFilterAdapter
 {
-    public void messageReceived( ProtocolHandler nextHandler,
+    public void messageReceived( NextFilter nextFilter,
                                  ProtocolSession session, Object message )
     {
         VmPipeSession vps = ( VmPipeSession ) session;
 
         vps.setIdle( IdleStatus.BOTH_IDLE, false );
         vps.setIdle( IdleStatus.READER_IDLE, false );
-        vps.increaseReadBytes( 0 );
+        vps.increaseReadBytes( 1 );
 
         // fire messageSent event first
-        vps.remoteFilters.messageSent( vps.remoteSession, message );
+        vps.remoteSession.getManagerFilterChain().messageSent( vps.remoteSession, message );
 
         // and then messageReceived
-        nextHandler.messageReceived( session, message );
+        nextFilter.messageReceived( session, message );
     }
 
     public void messageSent( ProtocolHandler nextHandler,
@@ -38,7 +38,7 @@
         VmPipeSession vps = ( VmPipeSession ) session;
         vps.setIdle( IdleStatus.BOTH_IDLE, false );
         vps.setIdle( IdleStatus.WRITER_IDLE, false );
-        vps.increaseWrittenBytes( 0 );
+        vps.increaseWrittenBytes( 1 );
 
         nextHandler.messageSent( session, message );
     }

Modified: directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeIdleStatusChecker.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeIdleStatusChecker.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeIdleStatusChecker.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeIdleStatusChecker.java Thu Apr 28 04:16:55 2005
@@ -82,7 +82,7 @@
                                                  idleTime > 0L
                                                  && ( currentTime - session.getLastIoTime() ) > idleTime );
                                 if( session.isIdle( IdleStatus.BOTH_IDLE ) )
-                                    session.localFilters
+                                    session.getManagerFilterChain()
                                             .sessionIdle( session,
                                                           IdleStatus.BOTH_IDLE );
                             }
@@ -95,7 +95,7 @@
                                                  idleTime > 0L
                                                  && ( currentTime - session.getLastReadTime() ) > idleTime );
                                 if( session.isIdle( IdleStatus.READER_IDLE ) )
-                                    session.localFilters
+                                    session.getManagerFilterChain()
                                             .sessionIdle( session,
                                                           IdleStatus.READER_IDLE );
                             }
@@ -108,7 +108,7 @@
                                                  idleTime > 0L
                                                  && ( currentTime - session.getLastWriteTime() ) > idleTime );
                                 if( session.isIdle( IdleStatus.WRITER_IDLE ) )
-                                    session.localFilters
+                                    session.getManagerFilterChain()
                                             .sessionIdle( session,
                                                           IdleStatus.WRITER_IDLE );
                             }

Modified: directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeSession.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeSession.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeSession.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeSession.java Thu Apr 28 04:16:55 2005
@@ -13,7 +13,9 @@
 import org.apache.mina.protocol.ProtocolDecoder;
 import org.apache.mina.protocol.ProtocolEncoder;
 import org.apache.mina.protocol.ProtocolHandler;
+import org.apache.mina.protocol.ProtocolHandlerFilterChain;
 import org.apache.mina.protocol.ProtocolSession;
+import org.apache.mina.protocol.ProtocolSessionFilterChain;
 import org.apache.mina.protocol.vmpipe.VmPipeAcceptor.Entry;
 
 /**
@@ -28,13 +30,13 @@
 
     private final SocketAddress remoteAddress;
 
-    private final ProtocolHandler localHandler;
+    private final ProtocolHandler handler;
     
     private final VmPipeSessionConfig config = new VmPipeSessionConfig();
 
-    final VmPipeFilterChain localFilters;
-
-    final VmPipeFilterChain remoteFilters;
+    private final ProtocolSessionFilterChain filterChain;
+    
+    private final VmPipeSessionManagerFilterChain managerFilterChain;
 
     final VmPipeSession remoteSession;
 
@@ -46,19 +48,19 @@
      * Constructor for client-side session.
      */
     VmPipeSession( Object lock, SocketAddress localAddress,
-                   VmPipeFilterChain localFilters,
-                   ProtocolHandler localHandler,
+                   VmPipeSessionManagerFilterChain managerFilterChain,
+                   ProtocolHandler handler,
                    SessionInitializer initializer,
                    Entry remoteEntry ) throws IOException
     {
         this.lock = lock;
         this.localAddress = localAddress;
-        this.localHandler = localHandler;
-        this.localFilters = localFilters;
         this.remoteAddress = remoteEntry.address;
-        this.remoteFilters = remoteEntry.filters;
+        this.handler = handler;
+        this.filterChain = new ProtocolSessionFilterChain( managerFilterChain );
+        this.managerFilterChain = managerFilterChain;
 
-        remoteSession = new VmPipeSession( this, remoteEntry.handler );
+        remoteSession = new VmPipeSession( this, remoteEntry );
         
         // initialize remote session
         try
@@ -76,28 +78,37 @@
         // initialize client session
         initializer.initializeSession( this );
 
-        remoteEntry.filters.sessionOpened( remoteSession );
-        localFilters.sessionOpened( this );
+        remoteEntry.managerFilterChain.sessionOpened( remoteSession );
+        managerFilterChain.sessionOpened( this );
     }
 
     /**
      * Constructor for server-side session.
      */
-    VmPipeSession( VmPipeSession remoteSession, ProtocolHandler localHandler )
+    VmPipeSession( VmPipeSession remoteSession, Entry entry )
     {
         this.lock = remoteSession.lock;
         this.localAddress = remoteSession.remoteAddress;
-        this.localHandler = localHandler;
-        this.localFilters = remoteSession.remoteFilters;
         this.remoteAddress = remoteSession.localAddress;
-        this.remoteFilters = remoteSession.localFilters;
-
+        this.handler = entry.handler;
+        this.managerFilterChain = entry.managerFilterChain;
+        this.filterChain = new ProtocolSessionFilterChain( entry.managerFilterChain );
         this.remoteSession = remoteSession;
     }
+    
+    VmPipeSessionManagerFilterChain getManagerFilterChain()
+    {
+        return managerFilterChain;
+    }
+    
+    public ProtocolHandlerFilterChain getFilterChain()
+    {
+        return filterChain;
+    }
 
     public ProtocolHandler getHandler()
     {
-        return localHandler;
+        return handler;
     }
 
     public ProtocolEncoder getEncoder()
@@ -118,14 +129,14 @@
                 return;
 
             closed = remoteSession.closed = true;
-            localFilters.sessionClosed( this );
-            remoteFilters.sessionClosed( remoteSession );
+            managerFilterChain.sessionClosed( this );
+            remoteSession.getManagerFilterChain().sessionClosed( remoteSession );
         }
     }
 
     public void write( Object message )
     {
-        localFilters.filterWrite( this, message );
+        this.filterChain.filterWrite( this, message );
     }
 
     public TransportType getTransportType()

Added: directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeSessionManagerFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeSessionManagerFilterChain.java?rev=165128&view=auto
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeSessionManagerFilterChain.java (added)
+++ directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeSessionManagerFilterChain.java Thu Apr 28 04:16:55 2005
@@ -0,0 +1,25 @@
+package org.apache.mina.protocol.vmpipe;
+
+import org.apache.mina.protocol.ProtocolSession;
+import org.apache.mina.protocol.ProtocolSessionManager;
+import org.apache.mina.protocol.ProtocolSessionManagerFilterChain;
+
+class VmPipeSessionManagerFilterChain extends ProtocolSessionManagerFilterChain {
+
+    VmPipeSessionManagerFilterChain( ProtocolSessionManager manager )
+    {
+        super( manager );
+    }
+
+    protected void doWrite( ProtocolSession session, Object message )
+    {
+        VmPipeSession s = ( VmPipeSession ) session;
+        
+        synchronized( s.lock )
+        {
+            if( s.closed )
+                throw new IllegalStateException( "Session is closed." );
+            s.remoteSession.getManagerFilterChain().messageReceived( s.remoteSession, message );
+        }
+    }
+}

Propchange: directory/network/trunk/src/java/org/apache/mina/protocol/vmpipe/VmPipeSessionManagerFilterChain.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/network/trunk/src/test/org/apache/mina/io/IoHandlerFilterChainTest.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/test/org/apache/mina/io/IoHandlerFilterChainTest.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/test/org/apache/mina/io/IoHandlerFilterChainTest.java (original)
+++ directory/network/trunk/src/test/org/apache/mina/io/IoHandlerFilterChainTest.java Thu Apr 28 04:16:55 2005
@@ -172,6 +172,11 @@
         {
             return null;
         }
+
+        public IoHandlerFilterChain getFilterChain()
+        {
+            return null;
+        }
     }
 
     private class TestFilter implements IoHandlerFilter

Modified: directory/network/trunk/src/test/org/apache/mina/protocol/ProtocolHandlerFilterChainTest.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/test/org/apache/mina/protocol/ProtocolHandlerFilterChainTest.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/test/org/apache/mina/protocol/ProtocolHandlerFilterChainTest.java (original)
+++ directory/network/trunk/src/test/org/apache/mina/protocol/ProtocolHandlerFilterChainTest.java Thu Apr 28 04:16:55 2005
@@ -171,6 +171,11 @@
         public SocketAddress getLocalAddress() {
             return null;
         }
+
+        public ProtocolHandlerFilterChain getFilterChain()
+        {
+            return null;
+        }
     }
 
     private class TestFilter implements ProtocolHandlerFilter

Modified: directory/network/trunk/src/test/org/apache/mina/protocol/codec/CumulativeProtocolDecoderTest.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/test/org/apache/mina/protocol/codec/CumulativeProtocolDecoderTest.java?rev=165128&r1=165127&r2=165128&view=diff
==============================================================================
--- directory/network/trunk/src/test/org/apache/mina/protocol/codec/CumulativeProtocolDecoderTest.java (original)
+++ directory/network/trunk/src/test/org/apache/mina/protocol/codec/CumulativeProtocolDecoderTest.java Thu Apr 28 04:16:55 2005
@@ -33,6 +33,7 @@
 import org.apache.mina.protocol.ProtocolDecoderOutput;
 import org.apache.mina.protocol.ProtocolEncoder;
 import org.apache.mina.protocol.ProtocolHandler;
+import org.apache.mina.protocol.ProtocolHandlerFilterChain;
 import org.apache.mina.protocol.ProtocolSession;
 import org.apache.mina.protocol.ProtocolViolationException;
 
@@ -209,6 +210,11 @@
         }
 
         public SocketAddress getLocalAddress() {
+            return null;
+        }
+
+        public ProtocolHandlerFilterChain getFilterChain()
+        {
             return null;
         }
     }



Mime
View raw message