1   /*
2    *  Copyright (c) 1998-2001, The University of Sheffield.
3    *
4    *  This file is part of GATE (see http://gate.ac.uk/), and is free
5    *  software, licenced under the GNU Library General Public License,
6    *  Version 2, June 1991 (in the distribution as file licence.html,
7    *  and also available at http://gate.ac.uk/gate/licence.html).
8    *
9    *  Valentin Tablan 21 Sep 2001
10   *
11   *  $Id: Executable.java,v 1.1 2001/09/26 18:23:05 valyt Exp $
12   */
13  package gate;
14  
15  import gate.util.*;
16  import gate.creole.*;
17  
18  /**
19   * Describes entities that can be executed such as {@link ProcessingResource}s
20   * or {@link Controller}s.
21   */
22  public interface Executable {
23  
24    /**
25     * Starts the execution of this executable
26     */
27    public void execute() throws ExecutionException;
28  
29    /**
30     * Notifies this executable that it should stop its execution as soon as
31     * possible.
32     */
33    public void interrupt();
34  
35    /**
36     * Returns true if this executable has been interrupted via the
37     * {@link interrupt()} method since the last time its {@link execute()} method
38     * was called
39     */
40    public boolean isInterrupted();
41  }