View Javadoc

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.filter.codec;
21  
22  import org.apache.mina.core.buffer.IoBuffer;
23  import org.apache.mina.core.session.IoSession;
24  
25  /**
26   * A special exception that tells the {@link ProtocolDecoder} can keep
27   * decoding even after this exception is thrown.
28   * <p>
29   * Once {@link ProtocolCodecFilter} catches any other type of exception
30   * than {@link RecoverableProtocolDecoderException}, it stops calling
31   * the {@link ProtocolDecoder#decode(IoSession, IoBuffer, ProtocolDecoderOutput)}
32   * immediately and fires an <tt>exceptionCaught</tt> event.
33   * <p>
34   * On the other hand, if {@link RecoverableProtocolDecoderException} is thrown,
35   * it doesn't stop immediately but keeps calling the {@link ProtocolDecoder}
36   * as long as the position of the read buffer changes.
37   * <p>
38   * {@link RecoverableProtocolDecoderException} is useful for a robust
39   * {@link ProtocolDecoder} that can continue decoding even after any
40   * protocol violation.
41   *
42   * @author The Apache MINA Project (dev@mina.apache.org)
43   * @version $Rev: 671827 $, $Date: 2008-06-26 10:49:48 +0200 (jeu, 26 jun 2008) $
44   */
45  public class RecoverableProtocolDecoderException extends
46          ProtocolDecoderException {
47  
48      private static final long serialVersionUID = -8172624045024880678L;
49  
50      public RecoverableProtocolDecoderException() {
51      }
52  
53      public RecoverableProtocolDecoderException(String message) {
54          super(message);
55      }
56  
57      public RecoverableProtocolDecoderException(Throwable cause) {
58          super(cause);
59      }
60  
61      public RecoverableProtocolDecoderException(String message, Throwable cause) {
62          super(message, cause);
63      }
64  
65  }