View Javadoc

1   /*
2    * Copyright (C) 2003-2004 Christian Siefkes <christian@siefkes.net>.
3    * Development of this software is supported by the German Research Society,
4    * Berlin-Brandenburg Graduate School in Distributed Information Systems
5    * (DFG grant no. GRK 316).
6    *
7    * This library is free software; you can redistribute it and/or
8    * modify it under the terms of the GNU Lesser General Public
9    * License as published by the Free Software Foundation; either
10   * version 2.1 of the License, or (at your option) any later version.
11   *
12   * This library is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this library; if not, visit
19   * http://www.gnu.org/licenses/lgpl.html or write to the Free Software
20   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
21   */
22  package de.fu_berlin.ties;
23  
24  import java.io.IOException;
25  
26  /***
27   * Classes implementing this interface announce that they should be closed
28   * for releasing all resources and stopping any background activity.
29   * The creator of a closeable instance is responsible for calling the
30   * {@link #close(int)} when the instance is no longer in use.
31   *
32   * @author Christian Siefkes
33   * @version $Revision: 1.4 $, $Date: 2004/05/18 14:06:41 $, $Author: siefkes $
34   */
35  public interface Closeable {
36  
37      /***
38       * Closes this instance, releasing all resources and stopping any
39       * background threads.
40       *
41       * @param errorCount the number of errors (exceptions) that occurred during
42       * calls to this instance (0 if none)
43       * @throws IOException if an I/O error occurs
44       * @throws ProcessingException if an error occurs during processing any
45       * remaining input
46       */
47       void close(final int errorCount) throws IOException, ProcessingException;
48  
49  }