directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r354316 - /directory/network/trunk/src/java/org/apache/mina/handler/chain/ChainedIoHandler.java
Date Tue, 06 Dec 2005 05:08:54 GMT
Author: trustin
Date: Mon Dec  5 21:08:50 2005
New Revision: 354316

URL: http://svn.apache.org/viewcvs?rev=354316&view=rev
Log:
Modified ChainedIoHandler to contain IoHandlerChain always

Modified:
    directory/network/trunk/src/java/org/apache/mina/handler/chain/ChainedIoHandler.java

Modified: directory/network/trunk/src/java/org/apache/mina/handler/chain/ChainedIoHandler.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/handler/chain/ChainedIoHandler.java?rev=354316&r1=354315&r2=354316&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/handler/chain/ChainedIoHandler.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/handler/chain/ChainedIoHandler.java Mon
Dec  5 21:08:50 2005
@@ -21,38 +21,46 @@
 import org.apache.mina.common.IoSession;
 
 /**
- * An {@link IoHandler} which executes an {@link IoHandlerCommand} or
- * an {@link IoHandlerChain} on a <tt>messageReceived</tt> event.
+ * An {@link IoHandler} which executes an {@link IoHandlerChain}
+ * on a <tt>messageReceived</tt> event.
  *
  * @author The Apache Directory Project (dev@directory.apache.org)
  * @version $Rev$, $Date$
  */
 public class ChainedIoHandler extends IoHandlerAdapter
 {
-    private final IoHandlerCommand command;
+    private final IoHandlerChain chain;
+
+    /**
+     * Creates a new instance which contains an empty {@link IoHandlerChain}.
+     */
+    public ChainedIoHandler()
+    {
+        chain = new IoHandlerChain();
+    }
 
     /**
      * Creates a new instance which executes the specified
-     * {@link IoHandlerCommand} on a <tt>messageReceived</tt> event.
+     * {@link IoHandlerChain} on a <tt>messageReceived</tt> event.
      * 
-     * @param command an {@link IoHandlerCommand} or an {@link IoHandlerChain} to execute
+     * @param chain an {@link IoHandlerChain} to execute
      */
-    public ChainedIoHandler( IoHandlerCommand command )
+    public ChainedIoHandler( IoHandlerChain chain )
     {
-        if( command == null )
+        if( chain == null )
         {
-            throw new NullPointerException( "command" );
+            throw new NullPointerException( "chain" );
         }
-        this.command = command;
+        this.chain = chain;
     }
     
     /**
      * Returns the {@link IoHandlerCommand} this handler will use to
      * handle <tt>messageReceived</tt> events.
      */
-    public IoHandlerCommand getCommand()
+    public IoHandlerChain getChain()
     {
-        return command;
+        return chain;
     }
 
     /**
@@ -62,6 +70,6 @@
      */
     public void messageReceived( IoSession session, Object message ) throws Exception
     {
-        command.execute( null, session, message);
+        chain.execute( null, session, message);
     }
 }



Mime
View raw message