directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r349941 - in /directory/network/branches/chain_refactor/src/java/org/apache/mina: common/ common/support/ registry/
Date Wed, 30 Nov 2005 13:10:40 GMT
Author: trustin
Date: Wed Nov 30 05:10:31 2005
New Revision: 349941

URL: http://svn.apache.org/viewcvs?rev=349941&view=rev
Log:
* Added IoSessionManager.getFilterChain()
* Added additional bind() method to ServiceRegistry

Modified:
    directory/network/branches/chain_refactor/src/java/org/apache/mina/common/IoFilterChainBuilder.java
    directory/network/branches/chain_refactor/src/java/org/apache/mina/common/IoSessionManager.java
    directory/network/branches/chain_refactor/src/java/org/apache/mina/common/support/BaseIoSessionManager.java
    directory/network/branches/chain_refactor/src/java/org/apache/mina/common/support/DelegatedIoAcceptor.java
    directory/network/branches/chain_refactor/src/java/org/apache/mina/common/support/DelegatedIoConnector.java
    directory/network/branches/chain_refactor/src/java/org/apache/mina/registry/ServiceRegistry.java
    directory/network/branches/chain_refactor/src/java/org/apache/mina/registry/SimpleServiceRegistry.java

Modified: directory/network/branches/chain_refactor/src/java/org/apache/mina/common/IoFilterChainBuilder.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/chain_refactor/src/java/org/apache/mina/common/IoFilterChainBuilder.java?rev=349941&r1=349940&r2=349941&view=diff
==============================================================================
--- directory/network/branches/chain_refactor/src/java/org/apache/mina/common/IoFilterChainBuilder.java
(original)
+++ directory/network/branches/chain_refactor/src/java/org/apache/mina/common/IoFilterChainBuilder.java
Wed Nov 30 05:10:31 2005
@@ -44,6 +44,11 @@
         public void buildFilterChain( IoFilterChain chain ) throws Exception
         {
         }
+        
+        public String toString()
+        {
+            return "NOOP";
+        }
     };
     
     /**

Modified: directory/network/branches/chain_refactor/src/java/org/apache/mina/common/IoSessionManager.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/chain_refactor/src/java/org/apache/mina/common/IoSessionManager.java?rev=349941&r1=349940&r2=349941&view=diff
==============================================================================
--- directory/network/branches/chain_refactor/src/java/org/apache/mina/common/IoSessionManager.java
(original)
+++ directory/network/branches/chain_refactor/src/java/org/apache/mina/common/IoSessionManager.java
Wed Nov 30 05:10:31 2005
@@ -49,6 +49,15 @@
     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> {2link IoFilterChain}.
+     * 
+     * @throws IllegalStateException if the current {@link IoFilterChainBuilder} is
+     *                               not a {@link DefaultIoFilterChainBuilder}
+     */
+    DefaultIoFilterChainBuilder getFilterChain();
+
+    /**
      * Returns the current exception monitor.
      */
     ExceptionMonitor getExceptionMonitor();

Modified: directory/network/branches/chain_refactor/src/java/org/apache/mina/common/support/BaseIoSessionManager.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/chain_refactor/src/java/org/apache/mina/common/support/BaseIoSessionManager.java?rev=349941&r1=349940&r2=349941&view=diff
==============================================================================
--- directory/network/branches/chain_refactor/src/java/org/apache/mina/common/support/BaseIoSessionManager.java
(original)
+++ directory/network/branches/chain_refactor/src/java/org/apache/mina/common/support/BaseIoSessionManager.java
Wed Nov 30 05:10:31 2005
@@ -58,6 +58,19 @@
         }
         filterChainBuilder = builder;
     }
+    
+    public DefaultIoFilterChainBuilder getFilterChain()
+    {
+        if( filterChainBuilder instanceof DefaultIoFilterChainBuilder )
+        {
+            return ( DefaultIoFilterChainBuilder ) filterChainBuilder;
+        }
+        else
+        {
+            throw new IllegalStateException(
+                    "Current filter chain builder is not a DefaultIoFilterChainBuilder."
);
+        }
+    }
 
     public ExceptionMonitor getExceptionMonitor()
     {

Modified: directory/network/branches/chain_refactor/src/java/org/apache/mina/common/support/DelegatedIoAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/chain_refactor/src/java/org/apache/mina/common/support/DelegatedIoAcceptor.java?rev=349941&r1=349940&r2=349941&view=diff
==============================================================================
--- directory/network/branches/chain_refactor/src/java/org/apache/mina/common/support/DelegatedIoAcceptor.java
(original)
+++ directory/network/branches/chain_refactor/src/java/org/apache/mina/common/support/DelegatedIoAcceptor.java
Wed Nov 30 05:10:31 2005
@@ -21,6 +21,7 @@
 import java.io.IOException;
 import java.net.SocketAddress;
 
+import org.apache.mina.common.DefaultIoFilterChainBuilder;
 import org.apache.mina.common.ExceptionMonitor;
 import org.apache.mina.common.IoAcceptor;
 import org.apache.mina.common.IoFilterChainBuilder;
@@ -83,6 +84,11 @@
     public void setFilterChainBuilder( IoFilterChainBuilder builder )
     {
         delegate.setFilterChainBuilder( builder );
+    }
+    
+    public DefaultIoFilterChainBuilder getFilterChain()
+    {
+        return delegate.getFilterChain();
     }
 
     /* TODO: DIRMINA-93

Modified: directory/network/branches/chain_refactor/src/java/org/apache/mina/common/support/DelegatedIoConnector.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/chain_refactor/src/java/org/apache/mina/common/support/DelegatedIoConnector.java?rev=349941&r1=349940&r2=349941&view=diff
==============================================================================
--- directory/network/branches/chain_refactor/src/java/org/apache/mina/common/support/DelegatedIoConnector.java
(original)
+++ directory/network/branches/chain_refactor/src/java/org/apache/mina/common/support/DelegatedIoConnector.java
Wed Nov 30 05:10:31 2005
@@ -22,6 +22,7 @@
 import java.net.SocketAddress;
 
 import org.apache.mina.common.ConnectFuture;
+import org.apache.mina.common.DefaultIoFilterChainBuilder;
 import org.apache.mina.common.ExceptionMonitor;
 import org.apache.mina.common.IoConnector;
 import org.apache.mina.common.IoFilterChainBuilder;
@@ -100,5 +101,10 @@
     public void setFilterChainBuilder( IoFilterChainBuilder builder )
     {
         delegate.setFilterChainBuilder( builder );
+    }
+
+    public DefaultIoFilterChainBuilder getFilterChain()
+    {
+        return delegate.getFilterChain();
     }
 }

Modified: directory/network/branches/chain_refactor/src/java/org/apache/mina/registry/ServiceRegistry.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/chain_refactor/src/java/org/apache/mina/registry/ServiceRegistry.java?rev=349941&r1=349940&r2=349941&view=diff
==============================================================================
--- directory/network/branches/chain_refactor/src/java/org/apache/mina/registry/ServiceRegistry.java
(original)
+++ directory/network/branches/chain_refactor/src/java/org/apache/mina/registry/ServiceRegistry.java
Wed Nov 30 05:10:31 2005
@@ -22,6 +22,7 @@
 import java.util.Set;
 
 import org.apache.mina.common.IoAcceptor;
+import org.apache.mina.common.IoFilterChainBuilder;
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.TransportType;
 
@@ -38,6 +39,11 @@
      * Binds the specified I/O handler to the specified service.
      */
     void bind( Service service, IoHandler ioHandler ) throws IOException;
+
+    /**
+     * Binds the specified I/O handler to the specified service.
+     */
+    void bind( Service service, IoHandler ioHandler, IoFilterChainBuilder filterChainBuilder
) throws IOException;
 
     /**
      * Unbinds the specified service (and its aggregated I/O handler or

Modified: directory/network/branches/chain_refactor/src/java/org/apache/mina/registry/SimpleServiceRegistry.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/chain_refactor/src/java/org/apache/mina/registry/SimpleServiceRegistry.java?rev=349941&r1=349940&r2=349941&view=diff
==============================================================================
--- directory/network/branches/chain_refactor/src/java/org/apache/mina/registry/SimpleServiceRegistry.java
(original)
+++ directory/network/branches/chain_refactor/src/java/org/apache/mina/registry/SimpleServiceRegistry.java
Wed Nov 30 05:10:31 2005
@@ -11,6 +11,7 @@
 import java.util.Set;
 
 import org.apache.mina.common.IoAcceptor;
+import org.apache.mina.common.IoFilterChainBuilder;
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.TransportType;
 import org.apache.mina.filter.ThreadPoolFilter;
@@ -44,10 +45,19 @@
     {
     }
 
-    public void bind( Service service, IoHandler ioHandler ) throws IOException
+    public void bind( Service service, IoHandler handler ) throws IOException
+    {
+        bind( service, handler, null );
+    }
+    
+    public void bind( Service service, IoHandler handler, IoFilterChainBuilder filterChainBuilder
) throws IOException
     {
         IoAcceptor acceptor = findAcceptor( service.getTransportType() );
-        acceptor.bind( service.getAddress(), ioHandler );
+        if( filterChainBuilder == null )
+        {
+            filterChainBuilder = IoFilterChainBuilder.NOOP;
+        }
+        acceptor.bind( service.getAddress(), handler, filterChainBuilder );
         startThreadPools();
         services.add( service );
     }
@@ -204,4 +214,6 @@
             throw ( InternalError ) new InternalError( "Unexpected exception." ).initCause(
e );
         }
     }
+    
+    private class IoFilterChainBuilderImpl 
 }



Mime
View raw message