directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r469763 - in /directory/trunks/apacheds/mitosis: ./ src/main/java/org/apache/directory/mitosis/service/ src/main/java/org/apache/directory/mitosis/service/protocol/codec/ src/test/java/org/apache/directory/mitosis/service/protocol/codec/
Date Wed, 01 Nov 2006 03:13:10 GMT
Author: trustin
Date: Tue Oct 31 19:13:09 2006
New Revision: 469763

URL: http://svn.apache.org/viewvc?view=rev&rev=469763
Log:
Fixed compilation errors

Modified:
    directory/trunks/apacheds/mitosis/   (props changed)
    directory/trunks/apacheds/mitosis/pom.xml
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageDecoder.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesAckMessageDecoder.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageDecoder.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryAckMessageDecoder.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageDecoder.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageDecoder.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageDecoder.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java

Propchange: directory/trunks/apacheds/mitosis/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Oct 31 19:13:09 2006
@@ -1,3 +1,5 @@
+
 target
 .classpath
 .project
+.settings

Modified: directory/trunks/apacheds/mitosis/pom.xml
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/pom.xml?view=diff&rev=469763&r1=469762&r2=469763
==============================================================================
--- directory/trunks/apacheds/mitosis/pom.xml (original)
+++ directory/trunks/apacheds/mitosis/pom.xml Tue Oct 31 19:13:09 2006
@@ -13,6 +13,15 @@
      Mitosis is the multi-master replications service included into Apache
      Directory Server
   </description>
+  
+  <repositories>
+    <repository>
+      <id>safehauS-m1-repository</id>
+      <name>SafeHaus.org Maven 1.x Repository</name>
+      <url>http://maven.safehaus.org/</url>
+      <layout>legacy</layout>
+    </repository>
+  </repositories>
 
   <!-- =======  Dependencies are declared here  ======= -->
   <dependencies>
@@ -20,13 +29,11 @@
     <dependency>
       <groupId>commons-collections</groupId>
       <artifactId>commons-collections</artifactId>
-      <version>3.2</version>
     </dependency>
 
     <dependency>
       <groupId>commons-dbcp</groupId>
       <artifactId>commons-dbcp</artifactId>
-      <version>1.2.1</version>
     </dependency>
 
     <dependency>
@@ -42,7 +49,6 @@
     <dependency>
       <groupId>jug</groupId>
       <artifactId>jug-asl</artifactId>
-      <version>2.0rc6</version>
     </dependency>
 
     <dependency>
@@ -53,7 +59,6 @@
     <dependency>
       <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-core</artifactId>
-      <version>${pom.version}</version>
     </dependency>
 
     <dependency>
@@ -64,18 +69,16 @@
     <dependency>
       <groupId>quartz</groupId>
       <artifactId>quartz</artifactId>
-      <version>1.5.2</version>
     </dependency>
 
     <dependency>
-      <groupId>jdbm</groupId>
-      <artifactId>jdbm</artifactId>
+      <groupId>org.apache.derby</groupId>
+      <artifactId>derby</artifactId>
     </dependency>
 
     <dependency>
       <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-core-shared</artifactId>
-      <version>${pom.version}</version>
     </dependency>
   </dependencies>
 

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java?view=diff&rev=469763&r1=469762&r2=469763
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java
Tue Oct 31 19:13:09 2006
@@ -19,23 +19,30 @@
  */
 package org.apache.directory.mitosis.service;
 
-import java.io.IOException;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
+import org.apache.directory.mitosis.common.Replica;
+import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
+import org.apache.directory.mitosis.service.protocol.handler.ReplicationClientProtocolHandler;
 import org.apache.mina.common.ConnectFuture;
+import org.apache.mina.common.ExecutorThreadModel;
 import org.apache.mina.common.IoConnector;
+import org.apache.mina.common.IoConnectorConfig;
 import org.apache.mina.common.IoSession;
+import org.apache.mina.common.RuntimeIOException;
 import org.apache.mina.filter.LoggingFilter;
-import org.apache.mina.filter.thread.ThreadPoolFilter;
 import org.apache.mina.transport.socket.nio.SocketConnector;
-import org.apache.directory.mitosis.common.Replica;
-import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
-import org.apache.directory.mitosis.service.protocol.handler.ReplicationClientProtocolHandler;
+import org.apache.mina.transport.socket.nio.SocketConnectorConfig;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import edu.emory.mathcs.backport.java.util.concurrent.ExecutorService;
+import edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue;
+import edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor;
+import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
+
 /**
  * Manages all outgoing connections to remote replicas.
  *
@@ -48,6 +55,7 @@
     
     private final ReplicationService service;
     private final IoConnector connector = new SocketConnector();
+    private final IoConnectorConfig connectorConfig = new SocketConnectorConfig();
     private final Map sessions = new HashMap();
     private ReplicationConfiguration configuration;
     private ConnectionMonitor monitor;
@@ -55,17 +63,18 @@
     ClientConnectionManager( ReplicationService service )
     {
         this.service = service;
+        
+        ExecutorThreadModel threadModel = ExecutorThreadModel.getInstance("mitosis");
+        threadModel.setExecutor(
+                new ThreadPoolExecutor(16, 16, 60, TimeUnit.SECONDS, new LinkedBlockingQueue()
));
+        connectorConfig.setThreadModel(threadModel);
+
+        //// add logger
+        connectorConfig.getFilterChain().addLast( "logger", new LoggingFilter() );
     }
 
     public void start( ReplicationConfiguration cfg ) throws Exception
     {
-        // initialze client connection
-        //// initialize thread pool
-        ThreadPoolFilter threadPoolFilter = new ThreadPoolFilter();
-        connector.getFilterChain().addLast( "threadPool", threadPoolFilter );
-        //// add logger
-        connector.getFilterChain().addLast( "logger", new LoggingFilter() );
-        
         this.configuration = cfg;
         
         monitor = new ConnectionMonitor();
@@ -78,8 +87,10 @@
         monitor.shutdown();
         
         // remove all filters
-        connector.getFilterChain().remove( "threadPool" );
-        connector.getFilterChain().remove( "logger" );
+        connector.getFilterChain().clear();
+        
+        ( ( ExecutorService ) ( ( ExecutorThreadModel ) connectorConfig.getThreadModel()
).
+                getExecutor() ).shutdown();
     }
     
     private class ConnectionMonitor extends Thread
@@ -264,10 +275,11 @@
             IoSession session;
             try
             {
-                connector.setConnectTimeout( configuration.getResponseTimeout() );
+                connectorConfig.setConnectTimeout( configuration.getResponseTimeout() );
                 ConnectFuture future = connector.connect(
                         replica.getAddress(),
-                        new ReplicationClientProtocolHandler( service ) );
+                        new ReplicationClientProtocolHandler( service ),
+                        connectorConfig );
                 
                 future.join();
                 session = future.getSession();
@@ -279,7 +291,7 @@
                     con.inProgress = false;
                 }
             }
-            catch( IOException e )
+            catch( RuntimeIOException e )
             {
                 log.warn("[" + replica + "] Failed to connect.", e );
             }

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java?view=diff&rev=469763&r1=469762&r2=469763
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java
Tue Oct 31 19:13:09 2006
@@ -21,9 +21,6 @@
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
-import java.net.ServerSocket;
-import java.net.SocketAddress;
-import java.nio.channels.ServerSocketChannel;
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -40,6 +37,16 @@
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
+import org.apache.directory.mitosis.common.CSN;
+import org.apache.directory.mitosis.common.Constants;
+import org.apache.directory.mitosis.common.ReplicaId;
+import org.apache.directory.mitosis.common.SimpleCSN;
+import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
+import org.apache.directory.mitosis.operation.Operation;
+import org.apache.directory.mitosis.operation.OperationFactory;
+import org.apache.directory.mitosis.service.protocol.codec.ReplicationServerProtocolCodecFactory;
+import org.apache.directory.mitosis.service.protocol.handler.ReplicationServerProtocolHandler;
+import org.apache.directory.mitosis.store.ReplicationStore;
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.configuration.InterceptorConfiguration;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
@@ -54,19 +61,10 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.mina.common.IoAcceptor;
 import org.apache.mina.common.IoServiceConfig;
-import org.apache.mina.common.TransportType;
+import org.apache.mina.filter.LoggingFilter;
 import org.apache.mina.filter.codec.ProtocolCodecFilter;
 import org.apache.mina.transport.socket.nio.SocketAcceptor;
 import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
-import org.apache.directory.mitosis.common.CSN;
-import org.apache.directory.mitosis.common.Constants;
-import org.apache.directory.mitosis.common.ReplicaId;
-import org.apache.directory.mitosis.common.SimpleCSN;
-import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
-import org.apache.directory.mitosis.operation.Operation;
-import org.apache.directory.mitosis.operation.OperationFactory;
-import org.apache.directory.mitosis.service.protocol.handler.ReplicationServerProtocolHandler;
-import org.apache.directory.mitosis.store.ReplicationStore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -139,12 +137,19 @@
         registry = new SocketAcceptor();
         IoServiceConfig config = new SocketAcceptorConfig();
 
-        config.getFilterChain().addLast( "protocol", new ProtocolCodecFilter( new ReplicationServerProtocolHandler(
this ) ) );
-        
+        config.getFilterChain().addLast(
+                "protocol",
+                new ProtocolCodecFilter( new ReplicationServerProtocolCodecFactory() ) );
+        
+        config.getFilterChain().addLast(
+                "logger",
+                new LoggingFilter());
+
         // bind server protocol provider
-        registry.bind( new InetSocketAddress( 10101 ),
-               new ServerHandler( true, new RunnableFactory() ),
-               config );
+        registry.bind(
+                new InetSocketAddress( 10101 ),
+                new ReplicationServerProtocolHandler(this),
+                config );
         
         clientConnectionManager.start( configuration );
     }
@@ -413,4 +418,5 @@
         Attribute deleted = entry.get( Constants.ENTRY_DELETED );
         return ( deleted != null && "true".equals( deleted.get().toString() ) );
     }
+
 }

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java?view=diff&rev=469763&r1=469762&r2=469763
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java
Tue Oct 31 19:13:09 2006
@@ -23,14 +23,16 @@
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.filter.codec.ProtocolDecoderException;
 import org.apache.directory.mitosis.common.CSNVector;
 import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.common.SimpleCSN;
 import org.apache.directory.mitosis.service.protocol.Constants;
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.BeginLogEntriesAckMessage;
+import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.IoSession;
+import org.apache.mina.filter.codec.ProtocolDecoderException;
+import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 
 public class BeginLogEntriesAckMessageDecoder extends ResponseMessageDecoder
 {
@@ -80,5 +82,9 @@
             
             updateVector.setCSN( new SimpleCSN( in.getLong(), replicaId, in.getInt() ) );
         }
+    }
+    
+    public void finishDecode( IoSession session, ProtocolDecoderOutput out ) throws Exception
+    {
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageDecoder.java?view=diff&rev=469763&r1=469762&r2=469763
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageDecoder.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageDecoder.java
Tue Oct 31 19:13:09 2006
@@ -23,6 +23,8 @@
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.BeginLogEntriesMessage;
 import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.IoSession;
+import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 
 public class BeginLogEntriesMessageDecoder extends BaseMessageDecoder {
 
@@ -35,5 +37,9 @@
             throws Exception
     {
         return new BeginLogEntriesMessage( sequence );
+    }
+
+    public void finishDecode( IoSession session, ProtocolDecoderOutput out ) throws Exception
+    {
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesAckMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesAckMessageDecoder.java?view=diff&rev=469763&r1=469762&r2=469763
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesAckMessageDecoder.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesAckMessageDecoder.java
Tue Oct 31 19:13:09 2006
@@ -23,6 +23,8 @@
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.EndLogEntriesAckMessage;
 import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.IoSession;
+import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 
 public class EndLogEntriesAckMessageDecoder extends ResponseMessageDecoder
 {
@@ -35,5 +37,9 @@
             int responseCode, ByteBuffer in ) throws Exception
     {
         return new EndLogEntriesAckMessage( sequence, responseCode );
+    }
+    
+    public void finishDecode( IoSession session, ProtocolDecoderOutput out ) throws Exception
+    {
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageDecoder.java?view=diff&rev=469763&r1=469762&r2=469763
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageDecoder.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageDecoder.java
Tue Oct 31 19:13:09 2006
@@ -23,6 +23,8 @@
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.EndLogEntriesMessage;
 import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.IoSession;
+import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 
 public class EndLogEntriesMessageDecoder extends BaseMessageDecoder {
 
@@ -35,5 +37,9 @@
             throws Exception
     {
         return new EndLogEntriesMessage( sequence );
+    }
+    
+    public void finishDecode( IoSession session, ProtocolDecoderOutput out ) throws Exception
+    {
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryAckMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryAckMessageDecoder.java?view=diff&rev=469763&r1=469762&r2=469763
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryAckMessageDecoder.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryAckMessageDecoder.java
Tue Oct 31 19:13:09 2006
@@ -23,6 +23,8 @@
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.LogEntryAckMessage;
 import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.IoSession;
+import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 
 public class LogEntryAckMessageDecoder extends ResponseMessageDecoder
 {
@@ -35,5 +37,9 @@
             int responseCode, ByteBuffer in ) throws Exception
     {
         return new LogEntryAckMessage( sequence, responseCode );
+    }
+    
+    public void finishDecode( IoSession session, ProtocolDecoderOutput out ) throws Exception
+    {
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageDecoder.java?view=diff&rev=469763&r1=469762&r2=469763
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageDecoder.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageDecoder.java
Tue Oct 31 19:13:09 2006
@@ -24,6 +24,8 @@
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.LogEntryMessage;
 import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.IoSession;
+import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 
 public class LogEntryMessageDecoder extends BaseMessageDecoder
 {
@@ -44,5 +46,8 @@
                 sequence,
                 operationCodec.decode( src ) );
     }
-
+    
+    public void finishDecode( IoSession session, ProtocolDecoderOutput out ) throws Exception
+    {
+    }
 }

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageDecoder.java?view=diff&rev=469763&r1=469762&r2=469763
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageDecoder.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageDecoder.java
Tue Oct 31 19:13:09 2006
@@ -23,6 +23,8 @@
 import java.nio.charset.CharsetDecoder;
 
 import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.IoSession;
+import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.service.protocol.Constants;
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
@@ -42,5 +44,8 @@
     {
         return new LoginAckMessage( sequence, responseCode, new ReplicaId( in.getString(
utf8decoder ) ) );
     }
-
+    
+    public void finishDecode( IoSession session, ProtocolDecoderOutput out ) throws Exception
+    {
+    }
 }

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageDecoder.java?view=diff&rev=469763&r1=469762&r2=469763
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageDecoder.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageDecoder.java
Tue Oct 31 19:13:09 2006
@@ -23,6 +23,8 @@
 import java.nio.charset.CharsetDecoder;
 
 import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.IoSession;
+import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.service.protocol.Constants;
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
@@ -42,5 +44,9 @@
                                       ByteBuffer in ) throws Exception
     {
         return new LoginMessage( sequence, new ReplicaId( in.getString( utf8decoder ) ) );
+    }
+    
+    public void finishDecode( IoSession session, ProtocolDecoderOutput out ) throws Exception
+    {
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java?view=diff&rev=469763&r1=469762&r2=469763
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java
Tue Oct 31 19:13:09 2006
@@ -25,10 +25,11 @@
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.WriteFuture;
+import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 import org.apache.mina.filter.codec.demux.MessageDecoder;
 import org.apache.mina.filter.codec.demux.MessageEncoder;
-import org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput;
 import org.apache.mina.filter.codec.support.SimpleProtocolEncoderOutput;
+import org.apache.mina.util.Queue;
 
 public abstract class AbstractMessageCodecTest extends TestCase
 {
@@ -75,15 +76,29 @@
         Assert.assertTrue( decoder.decodable( null, buf ) == MessageDecoder.OK );
         buf.reset();
         
-        SimpleProtocolDecoderOutput decoderOut = new SimpleProtocolDecoderOutput();
+        ProtocolDecoderOutputImpl decoderOut = new ProtocolDecoderOutputImpl();
         decoder.decode( null, buf, decoderOut );
         
         Assert.assertTrue( compare( message,
-                                    ( BaseMessage ) decoderOut.getMessageQueue().pop() )
);
+                                    ( BaseMessage ) decoderOut.messages.pop() ) );
     }
     
     protected boolean compare( BaseMessage expected, BaseMessage actual )
     {
         return expected.equals( actual );
+    }
+    
+    private class ProtocolDecoderOutputImpl implements ProtocolDecoderOutput
+    {
+        private final Queue messages = new Queue();
+
+        public void flush()
+        {
+        }
+
+        public void write(Object message)
+        {
+            messages.push(message);
+        }
     }
 }



Mime
View raw message