1 | package de.uka.ipd.sdq.pipesandfilters.framework.recorder; |
2 | |
3 | import de.uka.ipd.sdq.pipesandfilters.framework.PipeElement; |
4 | |
5 | /** |
6 | * This class is the super class of any recorder implementations. A recorder is |
7 | * responsible of making the measurements persistent, using a specified |
8 | * WriteStrategy. The measurements can either be aggregated before storing or be |
9 | * stored as raw measurements. |
10 | * |
11 | * @author Baum |
12 | * |
13 | */ |
14 | public abstract class Recorder extends PipeElement { |
15 | |
16 | /** |
17 | * The write strategy of the recorder. It determines in which way that |
18 | * measurement data is made persistent. |
19 | */ |
20 | protected IWriteStrategy writeStrategy; |
21 | |
22 | /** |
23 | * The default constructor for a recorder. This constructor sets |
24 | * MAX_IN_DEGREE to 1 and MAX_OUT_DEGREE to 0. |
25 | * |
26 | * @param writeStrategy |
27 | * The write strategy of the recorder. |
28 | */ |
29 | public Recorder(IWriteStrategy writeStrategy) { |
30 | super(1, 0); |
31 | this.writeStrategy = writeStrategy; |
32 | } |
33 | |
34 | /** |
35 | * The constructor of a Recorder. |
36 | * |
37 | * @param writeStrategy |
38 | * The write strategy of the recorder. |
39 | * @param MAX_INT_DEGREE |
40 | * The maximum in degree of the filter. |
41 | * @param MAX_OUT_DEGREE |
42 | * The maximum out degree of the filter. |
43 | */ |
44 | public Recorder(IWriteStrategy writeStrategy, int MAX_IN_DEGREE, |
45 | int MAX_OUT_DEGREE) { |
46 | super(MAX_IN_DEGREE, MAX_OUT_DEGREE); |
47 | this.writeStrategy = writeStrategy; |
48 | } |
49 | |
50 | /** |
51 | * Returns the write strategy of the recorder. |
52 | * |
53 | * @return The recorder's write strategy. |
54 | */ |
55 | public IWriteStrategy getWriteStrategy() { |
56 | return writeStrategy; |
57 | } |
58 | } |