1 | package de.uka.ipd.sdq.probespec.framework.probes.example; |
2 | |
3 | import de.uka.ipd.sdq.probespec.framework.ProbeType; |
4 | import de.uka.ipd.sdq.probespec.framework.probes.ProbeStrategyRegistry; |
5 | |
6 | /** |
7 | * Implementation of the {@link IProbeStrategyRegistry} interface for |
8 | * demonstration purposes. |
9 | * <p> |
10 | * Invoking the default constructor registers ProbeStrategies for the following |
11 | * <code>({@link ProbeType}, measurable entity)</code>-pairs. |
12 | * <ul> |
13 | * <li>{@link ProbeType#CURRENT_TIME}, <code>null</code></li> |
14 | * <li>{@link ProbeType#RESOURCE_DEMAND}, {@link SimpleCPUResource}</li> |
15 | * <li>{@link ProbeType#RESOURCE_STATE}, {@link SimpleCPUResource}</li> |
16 | * <li>{@link ProbeType#RESOURCE_STATE}, {@link ASimplePassiveResource}</li> |
17 | * <li>{@link ProbeType#SEFF_PARAMETER}, {@link SimpleSEFFParameter}</li> |
18 | * <li>{@link ProbeType#STOEX}, {@link SimpleStoEx}</li> |
19 | * </ul> |
20 | * |
21 | * @author Philipp Merkle |
22 | * |
23 | */ |
24 | public class ExampleProbeStrategyRegistry extends ProbeStrategyRegistry { |
25 | |
26 | /** |
27 | * Default constructor. Sets up the specific ProbeStrategies as described |
28 | * above. |
29 | */ |
30 | public ExampleProbeStrategyRegistry() { |
31 | setupProbeStrategies(); |
32 | } |
33 | |
34 | private void setupProbeStrategies() { |
35 | /* CURRENT_TIME */ |
36 | registerProbeStrategy(new ExampleTakeCurrentTimeStrategy(), |
37 | ProbeType.CURRENT_TIME, null); |
38 | |
39 | /* RESOURCE_DEMAND */ |
40 | // active resources |
41 | registerProbeStrategy(new ExampleTakeCPUDemandStrategy(), |
42 | ProbeType.RESOURCE_DEMAND, SimpleCPUResource.class); |
43 | |
44 | /* RESOURCE_STATE */ |
45 | // scheduled resources |
46 | registerProbeStrategy(new ExampleTakeCPUStateStrategy(), |
47 | ProbeType.RESOURCE_STATE, SimpleCPUResource.class); |
48 | |
49 | // passive resources |
50 | registerProbeStrategy(new ExampleTakePassiveResourceState(), |
51 | ProbeType.RESOURCE_STATE, ASimplePassiveResource.class); |
52 | |
53 | /* SEFF_PARAMETER */ |
54 | registerProbeStrategy(new ExampleTakeSEFFParameterStrategy(), |
55 | ProbeType.SEFF_PARAMETER, SimpleSEFFParameter.class); |
56 | |
57 | /* STOEX */ |
58 | registerProbeStrategy(new ExampleTakeStoExStrategy(), |
59 | ProbeType.STOEX, SimpleStoEx.class); |
60 | } |
61 | |
62 | } |