1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.mina.io;
20
21 import org.apache.mina.common.ByteBuffer;
22 import org.apache.mina.common.IdleStatus;
23
24 /***
25 * An abstract adapter class for {@link IoFilter}. You can extend this
26 * class and selectively override required event filter methods only. All
27 * methods forwards events to the next filter by default.
28 * <p>
29 * Please refer to
30 * <a href="../../../../../xref/org/apache/mina/io/filter/BlacklistFilter.html"><code>BlacklistFilter</code></a>
31 * example.
32 *
33 * @author The Apache Directory Project (dev@directory.apache.org)
34 * @version $Rev: 332218 $, $Date: 2005-11-10 12:52:42 +0900 $
35 */
36 public class IoFilterAdapter implements IoFilter
37 {
38 public void sessionOpened( NextFilter nextFilter, IoSession session ) throws Exception
39 {
40 nextFilter.sessionOpened( session );
41 }
42
43 public void sessionClosed( NextFilter nextFilter, IoSession session ) throws Exception
44 {
45 nextFilter.sessionClosed( session );
46 }
47
48 public void sessionIdle( NextFilter nextFilter, IoSession session,
49 IdleStatus status ) throws Exception
50 {
51 nextFilter.sessionIdle( session, status );
52 }
53
54 public void exceptionCaught( NextFilter nextFilter, IoSession session,
55 Throwable cause ) throws Exception
56 {
57 nextFilter.exceptionCaught( session, cause );
58 }
59
60 public void dataRead( NextFilter nextFilter, IoSession session,
61 ByteBuffer buf ) throws Exception
62 {
63 nextFilter.dataRead( session, buf );
64 }
65
66 public void dataWritten( NextFilter nextFilter, IoSession session,
67 Object marker ) throws Exception
68 {
69 nextFilter.dataWritten( session, marker );
70 }
71
72 public void filterWrite( NextFilter nextFilter, IoSession session,
73 ByteBuffer buf, Object marker ) throws Exception
74 {
75 nextFilter.filterWrite( session, buf, marker );
76 }
77 }