directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r122724 - in incubator/directory/network/trunk/mina/src/java/org/apache/mina: io protocol
Date Sun, 19 Dec 2004 00:23:15 GMT
Author: trustin
Date: Sat Dec 18 16:23:13 2004
New Revision: 122724

URL: http://svn.apache.org/viewcvs?view=rev&rev=122724
Log:
 * Added IoHandlerFilter and ProtocolHandlerFilter to provide filter chaining feature
 * Added adapters for *Handler and *HandlerFilter
Added:
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerAdapter.java
  (contents, props changed)
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java
  (contents, props changed)
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java
  (contents, props changed)
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerAdapter.java
  (contents, props changed)
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilter.java
  (contents, props changed)
   incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilterAdapter.java
  (contents, props changed)

Added: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerAdapter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerAdapter.java?view=auto&rev=122724
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerAdapter.java
Sat Dec 18 16:23:13 2004
@@ -0,0 +1,44 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.mina.io;
+
+import org.apache.mina.core.IdleStatus;
+
+/**
+ * TODO Document me.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public class IoHandlerAdapter implements IoHandler
+{
+
+    public void sessionOpened( IoSession session )
+    {
+    }
+
+    public void sessionClosed( IoSession session )
+    {
+    }
+
+    public void sessionIdle( IoSession session, IdleStatus status )
+    {
+    }
+
+    public void exceptionCaught( IoSession session, Throwable cause )
+    {
+    }
+
+    public void dataRead( IoSession session, int readBytes )
+    {
+    }
+
+    public void dataWritten( IoSession session, int writtenBytes )
+    {
+    }
+
+    public void markerReleased( IoSession session, Object marker )
+    {
+    }
+}

Added: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java?view=auto&rev=122724
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilter.java
Sat Dec 18 16:23:13 2004
@@ -0,0 +1,44 @@
+/*
+ *   @(#) $Id$
+ *
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.mina.io;
+
+import org.apache.mina.core.IdleStatus;
+
+/**
+ * TODO Insert type comment.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface IoHandlerFilter
+{
+    void sessionOpened( IoHandler nextHandler, IoSession session );
+
+    void sessionClosed( IoHandler nextHandler, IoSession session );
+
+    void sessionIdle( IoHandler nextHandler, IoSession session, IdleStatus status );
+
+    void exceptionCaught( IoHandler nextHandler, IoSession session, Throwable cause );
+
+    void dataRead( IoHandler nextHandler, IoSession session, int readBytes );
+
+    void dataWritten( IoHandler nextHandler, IoSession session, int writtenBytes );
+
+    void markerReleased( IoHandler nextHandler, IoSession session, Object marker );
+}
\ No newline at end of file

Added: incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java?view=auto&rev=122724
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/io/IoHandlerFilterAdapter.java
Sat Dec 18 16:23:13 2004
@@ -0,0 +1,57 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.mina.io;
+
+import org.apache.mina.core.IdleStatus;
+
+/**
+ * TODO Document me.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public class IoHandlerFilterAdapter implements IoHandlerFilter
+{
+
+    public void sessionOpened( IoHandler nextHandler, IoSession session )
+    {
+        nextHandler.sessionOpened( session );
+    }
+
+    public void sessionClosed( IoHandler nextHandler, IoSession session )
+    {
+        nextHandler.sessionClosed( session );
+    }
+
+    public void sessionIdle( IoHandler nextHandler, IoSession session,
+                            IdleStatus status )
+    {
+        nextHandler.sessionIdle( session, status );
+    }
+
+    public void exceptionCaught( IoHandler nextHandler, IoSession session,
+                                Throwable cause )
+    {
+        nextHandler.exceptionCaught( session, cause );
+    }
+
+    public void dataRead( IoHandler nextHandler, IoSession session,
+                         int readBytes )
+    {
+        nextHandler.dataRead( session, readBytes );
+    }
+
+    public void dataWritten( IoHandler nextHandler, IoSession session,
+                            int writtenBytes )
+    {
+        nextHandler.dataWritten( session, writtenBytes );
+    }
+
+    public void markerReleased( IoHandler nextHandler, IoSession session,
+                               Object marker )
+    {
+        nextHandler.markerReleased( session, marker );
+    }
+
+}
\ No newline at end of file

Added: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerAdapter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerAdapter.java?view=auto&rev=122724
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerAdapter.java
Sat Dec 18 16:23:13 2004
@@ -0,0 +1,40 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.mina.protocol;
+
+import org.apache.mina.core.IdleStatus;
+
+/**
+ * TODO Document me.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public class ProtocolHandlerAdapter implements ProtocolHandler
+{
+
+    public void sessionOpened( ProtocolSession session )
+    {
+    }
+
+    public void sessionClosed( ProtocolSession session )
+    {
+    }
+
+    public void sessionIdle( ProtocolSession session, IdleStatus status )
+    {
+    }
+
+    public void exceptionCaught( ProtocolSession session, Throwable cause )
+    {
+    }
+
+    public void messageReceived( ProtocolSession session, Object message )
+    {
+    }
+
+    public void messageSent( ProtocolSession session, Object message )
+    {
+    }
+}

Added: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilter.java?view=auto&rev=122724
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilter.java
Sat Dec 18 16:23:13 2004
@@ -0,0 +1,42 @@
+/*
+ *   @(#) $Id$
+ *
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.mina.protocol;
+
+import org.apache.mina.core.IdleStatus;
+
+/**
+ * TODO Insert type comment.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface ProtocolHandlerFilter
+{
+    void sessionOpened( ProtocolHandler nextHandler, ProtocolSession session );
+
+    void sessionClosed( ProtocolHandler nextHandler, ProtocolSession session );
+
+    void sessionIdle( ProtocolHandler nextHandler, ProtocolSession session, IdleStatus status
);
+
+    void exceptionCaught( ProtocolHandler nextHandler, ProtocolSession session, Throwable
cause );
+
+    void messageReceived( ProtocolHandler nextHandler, ProtocolSession session, Object message
);
+
+    void messageSent( ProtocolHandler nextHandler, ProtocolSession session, Object message
);
+}
\ No newline at end of file

Added: incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilterAdapter.java
Url: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilterAdapter.java?view=auto&rev=122724
==============================================================================
--- (empty file)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/protocol/ProtocolHandlerFilterAdapter.java
Sat Dec 18 16:23:13 2004
@@ -0,0 +1,52 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.mina.protocol;
+
+import org.apache.mina.core.IdleStatus;
+
+/**
+ * TODO Document me.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public class ProtocolHandlerFilterAdapter implements ProtocolHandlerFilter
+{
+
+    public void sessionOpened( ProtocolHandler nextHandler,
+                              ProtocolSession session )
+    {
+        nextHandler.sessionOpened( session );
+    }
+
+    public void sessionClosed( ProtocolHandler nextHandler,
+                              ProtocolSession session )
+    {
+        nextHandler.sessionClosed( session );
+    }
+
+    public void sessionIdle( ProtocolHandler nextHandler,
+                            ProtocolSession session, IdleStatus status )
+    {
+        nextHandler.sessionIdle( session, status );
+    }
+
+    public void exceptionCaught( ProtocolHandler nextHandler,
+                                ProtocolSession session, Throwable cause )
+    {
+        nextHandler.exceptionCaught( session, cause );
+    }
+
+    public void messageReceived( ProtocolHandler nextHandler,
+                                ProtocolSession session, Object message )
+    {
+        nextHandler.messageReceived( session, message );
+    }
+
+    public void messageSent( ProtocolHandler nextHandler,
+                            ProtocolSession session, Object message )
+    {
+        nextHandler.messageSent( session, message );
+    }
+}
\ No newline at end of file

Mime
View raw message