directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r372475 - in /directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina: common/ common/support/ transport/socket/nio/support/ transport/vmpipe/support/
Date Thu, 26 Jan 2006 08:06:10 GMT
Author: trustin
Date: Thu Jan 26 00:06:00 2006
New Revision: 372475

URL: http://svn.apache.org/viewcvs?rev=372475&view=rev
Log:
Revived global filter chain builder in IoService.

Modified:
    directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/IoService.java
    directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/IoServiceConfig.java
    directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/support/BaseIoService.java
    directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/support/DelegatedIoAcceptor.java
    directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/support/DelegatedIoConnector.java
    directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
    directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java
    directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketAcceptorDelegate.java
    directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketConnectorDelegate.java
    directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionImpl.java

Modified: directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/IoService.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/IoService.java?rev=372475&r1=372474&r2=372475&view=diff
==============================================================================
--- directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/IoService.java
(original)
+++ directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/IoService.java
Thu Jan 26 00:06:00 2006
@@ -51,4 +51,33 @@
      * any configuration.
      */
     IoServiceConfig getDefaultConfig();
+    
+    /**
+     * Returns the {@link IoFilterChainBuilder} which will modify the
+     * {@link IoFilterChain} of all {@link IoSession}s which is managed
+     * by this service.
+     * The default value is an empty {@link DefaultIoFilterChainBuilder}.
+     */
+    IoFilterChainBuilder getFilterChainBuilder();
+    
+    /**
+     * Sets the {@link IoFilterChainBuilder} which will modify the
+     * {@link IoFilterChain} of all {@link IoSession}s which is managed
+     * by this service.
+     * If you specify <tt>null</tt> this property will be set to
+     * an empty {@link DefaultIoFilterChainBuilder}.
+     */
+    void setFilterChainBuilder( IoFilterChainBuilder builder );
+    
+    /**
+     * A shortcut for <tt>( ( DefaultIoFilterChainBuilder ) </tt>{@link #getFilterChainBuilder()}<tt>
)</tt>.
+     * Please note that the returned object is not a <b>real</b> {@link IoFilterChain}
+     * but a {@link DefaultIoFilterChainBuilder}.  Modifying the returned builder
+     * won't affect the existing {@link IoSession}s at all, because
+     * {@link IoFilterChainBuilder}s affect only newly created {@link IoSession}s.
+     *
+     * @throws IllegalStateException if the current {@link IoFilterChainBuilder} is
+     *                               not a {@link DefaultIoFilterChainBuilder}
+     */
+    DefaultIoFilterChainBuilder getFilterChain();
 }

Modified: directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/IoServiceConfig.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/IoServiceConfig.java?rev=372475&r1=372474&r2=372475&view=diff
==============================================================================
--- directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/IoServiceConfig.java
(original)
+++ directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/IoServiceConfig.java
Thu Jan 26 00:06:00 2006
@@ -33,16 +33,16 @@
     
     /**
      * Returns the {@link IoFilterChainBuilder} which will modify the
-     * {@link IoFilterChain} of all {@link IoSession}s which is managed
-     * by this manager.
+     * {@link IoFilterChain} of all {@link IoSession}s which is created
+     * with this configuration.
      * The default value is an empty {@link DefaultIoFilterChainBuilder}.
      */
     IoFilterChainBuilder getFilterChainBuilder();
     
     /**
      * Sets the {@link IoFilterChainBuilder} which will modify the
-     * {@link IoFilterChain} of all {@link IoSession}s which is managed
-     * by this manager.
+     * {@link IoFilterChain} of all {@link IoSession}s which is created
+     * with this configuration.
      * If you specify <tt>null</tt> this property will be set to
      * an empty {@link DefaultIoFilterChainBuilder}.
      */

Modified: directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/support/BaseIoService.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/support/BaseIoService.java?rev=372475&r1=372474&r2=372475&view=diff
==============================================================================
--- directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/support/BaseIoService.java
(original)
+++ directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/support/BaseIoService.java
Thu Jan 26 00:06:00 2006
@@ -21,6 +21,8 @@
 import java.net.SocketAddress;
 import java.util.Set;
 
+import org.apache.mina.common.DefaultIoFilterChainBuilder;
+import org.apache.mina.common.IoFilterChainBuilder;
 import org.apache.mina.common.IoService;
 
 /**
@@ -29,7 +31,12 @@
  * @author The Apache Directory Project (dev@directory.apache.org)
  * @version $Rev$, $Date$
  */
-public abstract class BaseIoService implements IoService {
+public abstract class BaseIoService implements IoService
+{
+    /**
+     * Current filter chain builder.
+     */
+    private IoFilterChainBuilder filterChainBuilder = new DefaultIoFilterChainBuilder();
 
     protected BaseIoService()
     {
@@ -38,5 +45,32 @@
     public Set getManagedSessions( SocketAddress address )
     {
         throw new UnsupportedOperationException();
+    }
+    
+    public IoFilterChainBuilder getFilterChainBuilder()
+    {
+        return filterChainBuilder;
+    }
+
+    public void setFilterChainBuilder( IoFilterChainBuilder builder )
+    {
+        if( builder == null )
+        {
+            builder = new DefaultIoFilterChainBuilder();
+        }
+        filterChainBuilder = builder;
+    }
+    
+    public DefaultIoFilterChainBuilder getFilterChain()
+    {
+        if( filterChainBuilder instanceof DefaultIoFilterChainBuilder )
+        {
+            return ( DefaultIoFilterChainBuilder ) filterChainBuilder;
+        }
+        else
+        {
+            throw new IllegalStateException(
+                    "Current filter chain builder is not a DefaultIoFilterChainBuilder."
);
+        }
     }
 }

Modified: directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/support/DelegatedIoAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/support/DelegatedIoAcceptor.java?rev=372475&r1=372474&r2=372475&view=diff
==============================================================================
--- directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/support/DelegatedIoAcceptor.java
(original)
+++ directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/support/DelegatedIoAcceptor.java
Thu Jan 26 00:06:00 2006
@@ -22,7 +22,9 @@
 import java.net.SocketAddress;
 import java.util.Set;
 
+import org.apache.mina.common.DefaultIoFilterChainBuilder;
 import org.apache.mina.common.IoAcceptor;
+import org.apache.mina.common.IoFilterChainBuilder;
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoServiceConfig;
 import org.apache.mina.common.IoSession;
@@ -81,5 +83,20 @@
     public IoServiceConfig getDefaultConfig()
     {
         return delegate.getDefaultConfig();
+    }
+
+    public IoFilterChainBuilder getFilterChainBuilder()
+    {
+        return delegate.getFilterChainBuilder();
+    }
+
+    public void setFilterChainBuilder( IoFilterChainBuilder builder )
+    {
+        delegate.setFilterChainBuilder( builder );
+    }
+
+    public DefaultIoFilterChainBuilder getFilterChain()
+    {
+        return delegate.getFilterChain();
     }
 }

Modified: directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/support/DelegatedIoConnector.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/support/DelegatedIoConnector.java?rev=372475&r1=372474&r2=372475&view=diff
==============================================================================
--- directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/support/DelegatedIoConnector.java
(original)
+++ directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/common/support/DelegatedIoConnector.java
Thu Jan 26 00:06:00 2006
@@ -22,7 +22,9 @@
 import java.util.Set;
 
 import org.apache.mina.common.ConnectFuture;
+import org.apache.mina.common.DefaultIoFilterChainBuilder;
 import org.apache.mina.common.IoConnector;
+import org.apache.mina.common.IoFilterChainBuilder;
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoServiceConfig;
 
@@ -82,5 +84,20 @@
     public IoServiceConfig getDefaultConfig()
     {
         return delegate.getDefaultConfig();
+    }
+
+    public IoFilterChainBuilder getFilterChainBuilder()
+    {
+        return delegate.getFilterChainBuilder();
+    }
+
+    public void setFilterChainBuilder( IoFilterChainBuilder builder )
+    {
+        delegate.setFilterChainBuilder( builder );
+    }
+
+    public DefaultIoFilterChainBuilder getFilterChain()
+    {
+        return delegate.getFilterChain();
     }
 }

Modified: directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java?rev=372475&r1=372474&r2=372475&view=diff
==============================================================================
--- directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
(original)
+++ directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
Thu Jan 26 00:06:00 2006
@@ -200,6 +200,7 @@
         
         try
         {
+            this.getFilterChainBuilder().buildFilterChain( s.getFilterChain() );
             req.config.getFilterChainBuilder().buildFilterChain( s.getFilterChain() );
             ( ( DatagramFilterChain ) s.getFilterChain() ).sessionCreated( s );
         }

Modified: directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java?rev=372475&r1=372474&r2=372475&view=diff
==============================================================================
--- directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java
(original)
+++ directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java
Thu Jan 26 00:06:00 2006
@@ -545,6 +545,7 @@
             boolean success = false;
             try
             {
+                getFilterChainBuilder().buildFilterChain( session.getFilterChain() );
                 req.config.getFilterChainBuilder().buildFilterChain( session.getFilterChain()
);
                 ( ( DatagramFilterChain ) session.getFilterChain() ).sessionCreated( session
);
 

Modified: directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketAcceptorDelegate.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketAcceptorDelegate.java?rev=372475&r1=372474&r2=372475&view=diff
==============================================================================
--- directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketAcceptorDelegate.java
(original)
+++ directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketAcceptorDelegate.java
Thu Jan 26 00:06:00 2006
@@ -383,6 +383,7 @@
                             ( Set ) sessions.get( req.address ),
                             ( SocketSessionConfig ) req.config.getSessionConfig(),
                             ch, req.handler );
+                    getFilterChainBuilder().buildFilterChain( session.getFilterChain() );
                     req.config.getFilterChainBuilder().buildFilterChain( session.getFilterChain()
);
                     ( ( SocketFilterChain ) session.getFilterChain() ).sessionCreated( session
);
                     session.getManagedSessions().add( session );

Modified: directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketConnectorDelegate.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketConnectorDelegate.java?rev=372475&r1=372474&r2=372475&view=diff
==============================================================================
--- directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketConnectorDelegate.java
(original)
+++ directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketConnectorDelegate.java
Thu Jan 26 00:06:00 2006
@@ -285,6 +285,7 @@
                 ch, handler );
         try
         {
+            getFilterChainBuilder().buildFilterChain( session.getFilterChain() );
             config.getFilterChainBuilder().buildFilterChain( session.getFilterChain() );
             ( ( SocketFilterChain ) session.getFilterChain() ).sessionCreated( session );
         }

Modified: directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionImpl.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionImpl.java?rev=372475&r1=372474&r2=372475&view=diff
==============================================================================
--- directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionImpl.java
(original)
+++ directory/sandbox/trustin/dirmina-158/core/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionImpl.java
Thu Jan 26 00:06:00 2006
@@ -65,6 +65,7 @@
         // initialize remote session
         try
         {
+            remoteEntry.getAcceptor().getFilterChainBuilder().buildFilterChain( remoteSession.getFilterChain()
);
             remoteEntry.getConfig().getFilterChainBuilder().buildFilterChain( remoteSession.getFilterChain()
);
             ( ( VmPipeFilterChain ) remoteSession.getFilterChain() ).sessionCreated( remoteSession
);
         }
@@ -79,6 +80,7 @@
         // initialize client session
         try
         {
+            manager.getFilterChainBuilder().buildFilterChain( filterChain );
             filterChainBuilder.buildFilterChain( filterChain );
             handler.sessionCreated( this );
         }



Mime
View raw message