001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: *
019: */
020: package org.apache.mina.common;
021:
022: /**
023: * An abstract adapter class for {@link IoFilter}. You can extend
024: * this class and selectively override required event filter methods only. All
025: * methods forwards events to the next filter by default.
026: *
027: * @author The Apache MINA Project (dev@mina.apache.org)
028: * @version $Rev: 591770 $, $Date: 2007-11-04 05:22:44 -0700 (Sun, 04 Nov 2007) $
029: */
030: public class IoFilterAdapter implements IoFilter {
031: public void init() throws Exception {
032: }
033:
034: public void destroy() throws Exception {
035: }
036:
037: public void onPreAdd(IoFilterChain parent, String name,
038: NextFilter nextFilter) throws Exception {
039: }
040:
041: public void onPostAdd(IoFilterChain parent, String name,
042: NextFilter nextFilter) throws Exception {
043: }
044:
045: public void onPreRemove(IoFilterChain parent, String name,
046: NextFilter nextFilter) throws Exception {
047: }
048:
049: public void onPostRemove(IoFilterChain parent, String name,
050: NextFilter nextFilter) throws Exception {
051: }
052:
053: public void sessionCreated(NextFilter nextFilter, IoSession session)
054: throws Exception {
055: nextFilter.sessionCreated(session);
056: }
057:
058: public void sessionOpened(NextFilter nextFilter, IoSession session)
059: throws Exception {
060: nextFilter.sessionOpened(session);
061: }
062:
063: public void sessionClosed(NextFilter nextFilter, IoSession session)
064: throws Exception {
065: nextFilter.sessionClosed(session);
066: }
067:
068: public void sessionIdle(NextFilter nextFilter, IoSession session,
069: IdleStatus status) throws Exception {
070: nextFilter.sessionIdle(session, status);
071: }
072:
073: public void exceptionCaught(NextFilter nextFilter,
074: IoSession session, Throwable cause) throws Exception {
075: nextFilter.exceptionCaught(session, cause);
076: }
077:
078: public void messageReceived(NextFilter nextFilter,
079: IoSession session, Object message) throws Exception {
080: nextFilter.messageReceived(session, message);
081: }
082:
083: public void messageSent(NextFilter nextFilter, IoSession session,
084: WriteRequest writeRequest) throws Exception {
085: nextFilter.messageSent(session, writeRequest);
086: }
087:
088: public void filterWrite(NextFilter nextFilter, IoSession session,
089: WriteRequest writeRequest) throws Exception {
090: nextFilter.filterWrite(session, writeRequest);
091: }
092:
093: public void filterClose(NextFilter nextFilter, IoSession session)
094: throws Exception {
095: nextFilter.filterClose(session);
096: }
097:
098: public void filterSetTrafficMask(NextFilter nextFilter,
099: IoSession session, TrafficMask trafficMask)
100: throws Exception {
101: nextFilter.filterSetTrafficMask(session, trafficMask);
102: }
103: }
|