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 import org.apache.mina.util.SessionUtil;
24
25 /***
26 * An abstract adapter class for {@link IoHandler}. You can extend this class
27 * and selectively override required event handler methods only. All methods
28 * do nothing by default.
29 * <p>
30 * Please refer to
31 * <a href="../../../../../xref-examples/org/apache/mina/examples/netcat/NetCatProtocolHandler.html"><code>NetCatProtocolHandler</code></a>
32 * example.
33 *
34 * @author Trustin Lee (trustin@apache.org)
35 * @version $Rev: 210062 $, $Date: 2005-07-11 12:52:38 +0900 $
36 */
37 public class IoHandlerAdapter implements IoHandler
38 {
39 public void sessionCreated( IoSession session ) throws Exception
40 {
41 SessionUtil.initialize( session );
42 }
43
44 public void sessionOpened( IoSession session ) throws Exception
45 {
46 }
47
48 public void sessionClosed( IoSession session ) throws Exception
49 {
50 }
51
52 public void sessionIdle( IoSession session, IdleStatus status ) throws Exception
53 {
54 }
55
56 public void exceptionCaught( IoSession session, Throwable cause ) throws Exception
57 {
58 }
59
60 public void dataRead( IoSession session, ByteBuffer buf ) throws Exception
61 {
62 }
63
64 public void dataWritten( IoSession session, Object marker ) throws Exception
65 {
66 }
67 }