You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by tr...@apache.org on 2005/10/17 18:00:58 UTC

svn commit: r325918 - /directory/network/trunk/src/java/org/apache/mina/filter/codec/MessageEncoder.java

Author: trustin
Date: Mon Oct 17 09:00:51 2005
New Revision: 325918

URL: http://svn.apache.org/viewcvs?rev=325918&view=rev
Log:
MessageEncoder doesn't extend ProtocolEncoder anymore.

Modified:
    directory/network/trunk/src/java/org/apache/mina/filter/codec/MessageEncoder.java

Modified: directory/network/trunk/src/java/org/apache/mina/filter/codec/MessageEncoder.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/filter/codec/MessageEncoder.java?rev=325918&r1=325917&r2=325918&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/filter/codec/MessageEncoder.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/filter/codec/MessageEncoder.java Mon Oct 17 09:00:51 2005
@@ -20,6 +20,9 @@
 
 import java.util.Set;
 
+import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.IoSession;
+
 /**
  * Encodes messages of specific types specified by {@link #getMessageTypes()}.
  * 
@@ -30,10 +33,30 @@
  * @see DemuxingProtocolCodecFactory
  * @see MessageEncoderFactory
  */
-public interface MessageEncoder extends ProtocolEncoder
+public interface MessageEncoder
 {  
     /**
      * Returns the set of message classes this encoder can encode.
      */
     Set getMessageTypes();
+
+    /**
+     * Encodes higher-level message objects into binary or protocol-specific data.
+     * MINA invokes {@link #encode(IoSession, Object, ProtocolEncoderOutput)}
+     * method with message which is popped from the session write queue, and then
+     * the encoder implementation puts encoded {@link ByteBuffer}s into
+     * {@link ProtocolEncoderOutput}.
+     * 
+     * @throws Exception if the message violated protocol specification
+     */
+    void encode( IoSession session, Object message,
+                 ProtocolEncoderOutput out ) throws Exception;
+    
+    
+    /**
+     * Releases all resources related with this encoder.
+     * 
+     * @throws Exception if failed to dispose all resources
+     */
+    void dispose() throws Exception;
 }