KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > mina > common > IoFilterAdapter


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  *
19  */

20 package org.apache.mina.common;
21
22 /**
23  * An abstract adapter class for {@link IoFilter}. You can extend
24  * this class and selectively override required event filter methods only. All
25  * methods forwards events to the next filter by default.
26  *
27  * @author The Apache Directory Project (mina-dev@directory.apache.org)
28  * @version $Rev: 555855 $, $Date: 2007-07-13 12:19:00 +0900 (금, 13 7월 2007) $
29  */

30 public class IoFilterAdapter implements IoFilter {
31     public void init() throws Exception JavaDoc {
32     }
33
34     public void destroy() throws Exception JavaDoc {
35     }
36
37     public void onPreAdd(IoFilterChain parent, String JavaDoc name,
38             NextFilter nextFilter) throws Exception JavaDoc {
39     }
40
41     public void onPostAdd(IoFilterChain parent, String JavaDoc name,
42             NextFilter nextFilter) throws Exception JavaDoc {
43     }
44
45     public void onPreRemove(IoFilterChain parent, String JavaDoc name,
46             NextFilter nextFilter) throws Exception JavaDoc {
47     }
48
49     public void onPostRemove(IoFilterChain parent, String JavaDoc name,
50             NextFilter nextFilter) throws Exception JavaDoc {
51     }
52
53     public void sessionCreated(NextFilter nextFilter, IoSession session)
54             throws Exception JavaDoc {
55         nextFilter.sessionCreated(session);
56     }
57
58     public void sessionOpened(NextFilter nextFilter, IoSession session)
59             throws Exception JavaDoc {
60         nextFilter.sessionOpened(session);
61     }
62
63     public void sessionClosed(NextFilter nextFilter, IoSession session)
64             throws Exception JavaDoc {
65         nextFilter.sessionClosed(session);
66     }
67
68     public void sessionIdle(NextFilter nextFilter, IoSession session,
69             IdleStatus status) throws Exception JavaDoc {
70         nextFilter.sessionIdle(session, status);
71     }
72
73     public void exceptionCaught(NextFilter nextFilter, IoSession session,
74             Throwable JavaDoc cause) throws Exception JavaDoc {
75         nextFilter.exceptionCaught(session, cause);
76     }
77
78     public void messageReceived(NextFilter nextFilter, IoSession session,
79             Object JavaDoc message) throws Exception JavaDoc {
80         nextFilter.messageReceived(session, message);
81     }
82
83     public void messageSent(NextFilter nextFilter, IoSession session,
84             Object JavaDoc message) throws Exception JavaDoc {
85         nextFilter.messageSent(session, message);
86     }
87
88     public void filterWrite(NextFilter nextFilter, IoSession session,
89             WriteRequest writeRequest) throws Exception JavaDoc {
90         nextFilter.filterWrite(session, writeRequest);
91     }
92
93     public void filterClose(NextFilter nextFilter, IoSession session)
94             throws Exception JavaDoc {
95         nextFilter.filterClose(session);
96     }
97 }
Popular Tags