1 | package de.uka.ipd.sdq.simucomframework.probes; |
2 | |
3 | import de.uka.ipd.sdq.probespec.framework.ProbeType; |
4 | import de.uka.ipd.sdq.probespec.framework.probes.IProbeStrategyRegistry; |
5 | import de.uka.ipd.sdq.probespec.framework.probes.ProbeStrategyRegistry; |
6 | import de.uka.ipd.sdq.scheduler.IPassiveResource; |
7 | import de.uka.ipd.sdq.simucomframework.resources.AbstractScheduledResource; |
8 | |
9 | /** |
10 | * Implementation of the {@link IProbeStrategyRegistry} interface for SimuCom. |
11 | * <p> |
12 | * Invoking the default constructor registers ProbeStrategies for the following |
13 | * <code>({@link ProbeType}, measurable entity)</code>-pairs. |
14 | * <ul> |
15 | * <li>{@link ProbeType#CURRENT_TIME}, <code>null</code></li> |
16 | * <li>{@link ProbeType#RESOURCE_DEMAND}, {@link AbstractScheduledResource}</li> |
17 | * <li>{@link ProbeType#RESOURCE_STATE}, {@link AbstractScheduledResource}</li> |
18 | * <li>{@link ProbeType#RESOURCE_STATE}, {@link IPassiveResource}</li> |
19 | * <li>{@link ProbeType#EXECUTION_RESULT}, <code>null</code></li> |
20 | * </ul> |
21 | * |
22 | * @author Philipp Merkle, brosch |
23 | * |
24 | */ |
25 | public class SimuComProbeStrategyRegistry extends ProbeStrategyRegistry { |
26 | |
27 | /** |
28 | * Default constructor. Sets up the SimuCom specific ProbeStrategies as |
29 | * described above. |
30 | */ |
31 | public SimuComProbeStrategyRegistry() { |
32 | setupProbeStrategies(); |
33 | } |
34 | |
35 | private void setupProbeStrategies() { |
36 | /* CURRENT_TIME */ |
37 | registerProbeStrategy(new TakeSimulatedTimeStrategy(), |
38 | ProbeType.CURRENT_TIME, null); |
39 | |
40 | /* RESOURCE_DEMAND */ |
41 | // scheduled resources |
42 | registerProbeStrategy(new TakeScheduledResourceDemandStrategy(), |
43 | ProbeType.RESOURCE_DEMAND, AbstractScheduledResource.class); |
44 | |
45 | /* RESOURCE_STATE */ |
46 | // scheduled resources |
47 | registerProbeStrategy(new TakeScheduledResourceStateStrategy(), |
48 | ProbeType.RESOURCE_STATE, AbstractScheduledResource.class); |
49 | |
50 | // passive resources |
51 | registerProbeStrategy(new TakePassiveResourceStateStrategy(), |
52 | ProbeType.RESOURCE_STATE, IPassiveResource.class); |
53 | |
54 | // execution result |
55 | registerProbeStrategy(new TakeExecutionResultStrategy(), |
56 | ProbeType.EXECUTION_RESULT, null); |
57 | } |
58 | |
59 | } |