|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
IRunnerPooled.java | - | - | - | - |
|
1 | /** | |
2 | * JTRunner is free software; you can redistribute it and/or modify it under the | |
3 | * terms of the GNU General Public License as published by the Free Software | |
4 | * Foundation; either version 2, or (at your option) any later version. | |
5 | */ | |
6 | ||
7 | package jtr.runners; | |
8 | ||
9 | import jtr.pool.RunnerPool; | |
10 | ||
11 | /** | |
12 | * This interface describes a runner in its <code>POOLED</code> state.<br> | |
13 | * Thus the runner is finally elegible for leaving the pool and running | |
14 | * according to the provided configuration. | |
15 | * | |
16 | * @author Francesco Russo (frusso@dev.java.net) | |
17 | * @version 4.0 | |
18 | * @since 1.0 | |
19 | */ | |
20 | public interface IRunnerPooled extends Runnable, IRunnerParameterized { | |
21 | /** | |
22 | * @see java.lang.Runnable#run() | |
23 | */ | |
24 | public void run(); | |
25 | ||
26 | /** | |
27 | * Get the pool the current runner belongs to. | |
28 | * | |
29 | * @return RunnerPool | |
30 | */ | |
31 | public RunnerPool getPool(); | |
32 | ||
33 | /** | |
34 | * Get the current jtr-test epoch. | |
35 | * | |
36 | * @return int | |
37 | */ | |
38 | public int getEpoch(); | |
39 | ||
40 | /** | |
41 | * Set the current jtr-test epoch. | |
42 | * | |
43 | * @param epoch | |
44 | * int | |
45 | */ | |
46 | public void setEpoch(int epoch); | |
47 | ||
48 | /** | |
49 | * This method has to be implemented by all concrete <code>IRunner</code> | |
50 | * implementations for performing resource clean-up operations (closing | |
51 | * connections, closing files, etc.).<br> | |
52 | * In the current release of JTR, the framework will start the resource | |
53 | * clean-up session only upon completion of the last epoch and once all the | |
54 | * <code>IRunner</code>s have been put back into the pool.<br> | |
55 | * For an <code>IRunner</code> extending the | |
56 | * <code>AbstractJMSRunner</code> abstract class, the injection of all the | |
57 | * JMS administered objects and connections will happen only once, before | |
58 | * the first run of the first epoch is started.<br> | |
59 | * This is for not wasting both time and resources for gathering always the | |
60 | * same resources every time a new run has to be executed. | |
61 | * | |
62 | * @see jtr.runners.AbstractRunnerAncestor#clean() | |
63 | */ | |
64 | public void cleanupResources(); | |
65 | } |
|