1 | /* |
2 | * @(#) $Id: ProtocolFilterAdapter.java 327113 2005-10-21 06:59:15Z trustin $ |
3 | * |
4 | * Copyright 2004 The Apache Software Foundation |
5 | * |
6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
7 | * you may not use this file except in compliance with the License. |
8 | * 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, software |
13 | * distributed under the License is distributed on an "AS IS" BASIS, |
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
15 | * See the License for the specific language governing permissions and |
16 | * limitations under the License. |
17 | * |
18 | */ |
19 | package org.apache.mina.protocol; |
20 | |
21 | import org.apache.mina.common.IdleStatus; |
22 | |
23 | /** |
24 | * An abstract adapter class for {@link ProtocolFilter}. You can extend |
25 | * this class and selectively override required event filter methods only. All |
26 | * methods forwards events to the next filter by default. |
27 | * |
28 | * @author The Apache Directory Project (dev@directory.apache.org) |
29 | * @version $Rev: 327113 $, $Date: 2005-10-21 15:59:15 +0900 $ |
30 | */ |
31 | public class ProtocolFilterAdapter implements ProtocolFilter |
32 | { |
33 | public void sessionOpened( NextFilter nextFilter, |
34 | ProtocolSession session ) |
35 | { |
36 | nextFilter.sessionOpened( session ); |
37 | } |
38 | |
39 | public void sessionClosed( NextFilter nextFilter, |
40 | ProtocolSession session ) |
41 | { |
42 | nextFilter.sessionClosed( session ); |
43 | } |
44 | |
45 | public void sessionIdle( NextFilter nextFilter, |
46 | ProtocolSession session, IdleStatus status ) |
47 | { |
48 | nextFilter.sessionIdle( session, status ); |
49 | } |
50 | |
51 | public void exceptionCaught( NextFilter nextFilter, |
52 | ProtocolSession session, Throwable cause ) |
53 | { |
54 | nextFilter.exceptionCaught( session, cause ); |
55 | } |
56 | |
57 | public void messageReceived( NextFilter nextFilter, |
58 | ProtocolSession session, Object message ) |
59 | { |
60 | nextFilter.messageReceived( session, message ); |
61 | } |
62 | |
63 | public void messageSent( NextFilter nextFilter, |
64 | ProtocolSession session, Object message ) |
65 | { |
66 | nextFilter.messageSent( session, message ); |
67 | } |
68 | |
69 | public void filterWrite( NextFilter nextFilter, ProtocolSession session, Object message ) |
70 | { |
71 | nextFilter.filterWrite( session, message ); |
72 | } |
73 | } |