View Javadoc

1   /*
2    * (C)opyright 2010, Nikolaos Georgosopoulos
3    *
4    * This file is part of URLChecker.
5   
6       URLChecker is free software: you can redistribute it and/or modify
7       it under the terms of the Lesser General Public License as published by
8       the Free Software Foundation, either version 3 of the License, or
9       (at your option) any later version.
10  
11      URLChecker is distributed in the hope that it will be useful,
12      but WITHOUT ANY WARRANTY; without even the implied warranty of
13      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14      GNU General Public License for more details.
15  
16      You should have received a copy of the Lesser General Public License
17      along with URLChecker.  If not, see <http://www.gnu.org/licenses/>.
18  
19   */
20  package net.sf.urlchecker.exception.handling;
21  
22  import java.io.IOException;
23  
24  /**
25   * The Interface ExceptionHandler. This interface has been Gerenified to allow
26   * usage by both the old and the new httpClient. Future versions of the library
27   * may not have this interface in a Generic form.
28   * 
29   * @param <T>
30   *            the generic type
31   *            <p>
32   *            <b> $Id: ExceptionHandler.java 180 2010-12-12 18:47:56Z georgosn
33   *            $</b>
34   *            </p>
35   * 
36   * @author $LastChangedBy: georgosn $
37   * @version $LastChangedRevision: 182 $
38   */
39  public interface ExceptionHandler<T> {
40  
41      /**
42       * Handle.
43       * 
44       * @param method
45       *            the method
46       * @param exception
47       *            the exception
48       * @param retryCount
49       *            the retry count
50       * @return true, if successful
51       * @param <T>
52       *            a T object.
53       */
54      boolean handle(T method, IOException exception, int retryCount);
55  }