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 */
020package org.apache.mina.filter.codec;
021
022/**
023 * A special exception that tells the {@link ProtocolDecoder} can keep
024 * decoding even after this exception is thrown.
025 * <p>
026 * Once {@link ProtocolCodecFilter} catches any other type of exception
027 * than {@link RecoverableProtocolDecoderException}, it stops calling
028 * the {@link ProtocolDecoder#decode(org.apache.mina.core.session.IoSession,
029 *        org.apache.mina.core.buffer.IoBuffer, ProtocolDecoderOutput)}
030 * immediately and fires an <tt>exceptionCaught</tt> event.
031 * <p>
032 * On the other hand, if {@link RecoverableProtocolDecoderException} is thrown,
033 * it doesn't stop immediately but keeps calling the {@link ProtocolDecoder}
034 * as long as the position of the read buffer changes.
035 * <p>
036 * {@link RecoverableProtocolDecoderException} is useful for a robust
037 * {@link ProtocolDecoder} that can continue decoding even after any
038 * protocol violation.
039 *
040 * @author <a href="http://mina.apache.org">Apache MINA Project</a>
041 */
042public class RecoverableProtocolDecoderException extends ProtocolDecoderException {
043
044    private static final long serialVersionUID = -8172624045024880678L;
045
046    public RecoverableProtocolDecoderException() {
047        // Do nothing
048    }
049
050    public RecoverableProtocolDecoderException(String message) {
051        super(message);
052    }
053
054    public RecoverableProtocolDecoderException(Throwable cause) {
055        super(cause);
056    }
057
058    public RecoverableProtocolDecoderException(String message, Throwable cause) {
059        super(message, cause);
060    }
061
062}