1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.mina.protocol;
20
21 import org.apache.mina.common.IdleStatus;
22 import org.apache.mina.util.SessionUtil;
23
24 /***
25 * An abstract adapter class for {@link ProtocolHandler}. You can extend this
26 * class and selectively override required event handler methods only. All
27 * methods do nothing by default.
28 *
29 * @author Trustin Lee (trustin@apache.org)
30 * @version $Rev: 210062 $, $Date: 2005-07-11 12:52:38 +0900 $
31 */
32 public class ProtocolHandlerAdapter implements ProtocolHandler
33 {
34 public void sessionCreated( ProtocolSession session ) throws Exception
35 {
36 SessionUtil.initialize( session );
37 }
38
39 public void sessionOpened( ProtocolSession session ) throws Exception
40 {
41 }
42
43 public void sessionClosed( ProtocolSession session ) throws Exception
44 {
45 }
46
47 public void sessionIdle( ProtocolSession session, IdleStatus status ) throws Exception
48 {
49 }
50
51 public void exceptionCaught( ProtocolSession session, Throwable cause ) throws Exception
52 {
53 }
54
55 public void messageReceived( ProtocolSession session, Object message ) throws Exception
56 {
57 }
58
59 public void messageSent( ProtocolSession session, Object message ) throws Exception
60 {
61 }
62 }