View Javadoc

1   // Copyright (C) 2000 Paco Gomez
2   // Copyright (C) 2000 - 2008 Philip Aston
3   // All rights reserved.
4   //
5   // This file is part of The Grinder software distribution. Refer to
6   // the file LICENSE which is part of The Grinder distribution for
7   // licensing details. The Grinder distribution is available on the
8   // Internet at http://grinder.sourceforge.net/
9   //
10  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
11  // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
12  // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
13  // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
14  // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
15  // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
16  // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
17  // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
18  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
19  // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
20  // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
21  // OF THE POSSIBILITY OF SUCH DAMAGE.
22  
23  package net.grinder.plugininterface;
24  
25  
26  /**
27   * <p>This class is used to share thread information between the
28   * Grinder and the plug-in. </p>
29   *
30   * @author Paco Gomez
31   * @author Philip Aston
32   */
33  public interface PluginThreadContext {
34  
35    /**
36     * Return the thread number.
37     *
38     * @return The thread number.
39     */
40    int getThreadNumber();
41  
42    /**
43     * Return the current run number.
44     *
45     * @return The current run number.
46     */
47    int getRunNumber();
48  
49    /**
50     * The time taken between invocations of {@link #pauseClock()} and
51     * {@link #resumeClock} is not included in the recorded time for a test. This
52     * allows plug-ins to discount the cost of expensive pre or post processing.
53     *
54     * <p>
55     * Has no effect if called when the is no dispatch in progress.
56     * </p>
57     */
58    void pauseClock();
59  
60    /**
61     * @see #pauseClock()
62     */
63    void resumeClock();
64  }