directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r719426 - /directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java
Date Thu, 20 Nov 2008 23:43:57 GMT
Author: elecharny
Date: Thu Nov 20 15:43:57 2008
New Revision: 719426

URL: http://svn.apache.org/viewvc?rev=719426&view=rev
Log:
Added an ExecutorFilter to allow the responses to be flushed immediately instead of being
stacked in a queue.

Modified:
    directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java?rev=719426&r1=719425&r2=719426&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java
(original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java
Thu Nov 20 15:43:57 2008
@@ -76,9 +76,12 @@
 import org.apache.mina.core.filterchain.IoFilterChainBuilder;
 import org.apache.mina.core.future.WriteFuture;
 import org.apache.mina.core.service.IoHandler;
+import org.apache.mina.core.session.IoEventType;
 import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFactory;
 import org.apache.mina.filter.codec.ProtocolCodecFilter;
+import org.apache.mina.filter.executor.ExecutorFilter;
+import org.apache.mina.filter.executor.OrderedThreadPoolExecutor;
 import org.apache.mina.handler.demux.MessageHandler;
 import org.apache.mina.transport.socket.SocketAcceptor;
 import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
@@ -325,6 +328,13 @@
         // Inject the codec into the chain
         ((DefaultIoFilterChainBuilder)chain).addLast( "codec", 
                 new ProtocolCodecFilter( this.getProtocolCodecFactory() ) );
+        
+        // Now inject an ExecutorFilter for the write operations
+        // We use the same number of thread than the number of IoProcessor
+        // (NOTE : this has to be double checked)
+        ((DefaultIoFilterChainBuilder)chain).addLast( "executor", 
+                new ExecutorFilter( new OrderedThreadPoolExecutor( getNbTcpThreads() ), 
+                    IoEventType.WRITE ) );
 
         /*
          * The server is now initialized, we can



Mime
View raw message