Benchmarkable.java
01 /*
02  *  Benchmarkable.java
03  *
04  *  Copyright (c) 1995-2010, The University of Sheffield. See the file
05  *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
06  *
07  *  This file is part of GATE (see http://gate.ac.uk/), and is free
08  *  software, licenced under the GNU Library General Public License,
09  *  Version 2, June 1991 (in the distribution as file licence.html,
10  *  and also available at http://gate.ac.uk/gate/licence.html).
11  */
12 
13 package gate.util;
14 
15 import org.apache.log4j.Logger;
16 
17 /**
18  * Resources that want to log their progress or results into a shared
19  * log centrally maintained by GATE, should implement this interface and
20  * use the java.util.Benchmark class to log their entries.
21  
22  @author niraj
23  */
24 public interface Benchmarkable {
25 
26   /**
27    * Returns the benchmark ID of this resource.
28    
29    @return
30    */
31   public String getBenchmarkId();
32 
33   /**
34    * This method sets the benchmarkID for this resource. The resource
35    * must use this as the prefix for any sub-events it logs.
36    
37    @param benchmarkId the benchmark ID, which must not contain spaces
38    *  as it is already used as a separator in the log, you can use
39    {@link Benchmark#createBenchmarkId(String, String)} for it. 
40    */
41   public void setBenchmarkId(String benchmarkId);
42 
43 }