EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.probespec.framework]

COVERAGE SUMMARY FOR SOURCE FILE [ProbeSpecContext.java]

nameclass, %method, %block, %line, %
ProbeSpecContext.java0%   (0/1)0%   (0/17)0%   (0/121)0%   (0/40)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ProbeSpecContext0%   (0/1)0%   (0/17)0%   (0/121)0%   (0/40)
ProbeSpecContext (): void 0%   (0/1)0%   (0/23)0%   (0/6)
finish (): void 0%   (0/1)0%   (0/20)0%   (0/5)
getBlackboardGarbageCollector (): IRegionBasedGarbageCollector 0%   (0/1)0%   (0/3)0%   (0/1)
getCalculatorFactory (): ICalculatorFactory 0%   (0/1)0%   (0/5)0%   (0/2)
getCalculatorRegistry (): CalculatorRegistry 0%   (0/1)0%   (0/3)0%   (0/1)
getPipeManagerRegisty (): Registry 0%   (0/1)0%   (0/5)0%   (0/2)
getProbeStrategyRegistry (): IProbeStrategyRegistry 0%   (0/1)0%   (0/5)0%   (0/2)
getSampleBlackboard (): ISampleBlackboard 0%   (0/1)0%   (0/5)0%   (0/2)
getThreadManager (): ThreadManager 0%   (0/1)0%   (0/3)0%   (0/1)
initialise (ISampleBlackboard, IProbeStrategyRegistry, ICalculatorFactory): void 0%   (0/1)0%   (0/13)0%   (0/5)
obtainOriginalProbeSetId (Integer): String 0%   (0/1)0%   (0/5)0%   (0/1)
obtainProbeSetId (String): Integer 0%   (0/1)0%   (0/6)0%   (0/1)
setBlackboardGarbageCollector (IRegionBasedGarbageCollector): void 0%   (0/1)0%   (0/4)0%   (0/2)
setCalculatorFactory (ICalculatorFactory): void 0%   (0/1)0%   (0/4)0%   (0/2)
setProbeStrategyRegistry (IProbeStrategyRegistry): void 0%   (0/1)0%   (0/4)0%   (0/2)
setSampleBlackboard (ISampleBlackboard): void 0%   (0/1)0%   (0/4)0%   (0/2)
throwExceptionIfNotInitialised (): void 0%   (0/1)0%   (0/9)0%   (0/3)

1package de.uka.ipd.sdq.probespec.framework;
2 
3import de.uka.ipd.sdq.pipesandfilters.framework.PipesAndFiltersManager;
4import de.uka.ipd.sdq.probespec.framework.calculator.CalculatorRegistry;
5import de.uka.ipd.sdq.probespec.framework.calculator.ICalculatorFactory;
6import de.uka.ipd.sdq.probespec.framework.concurrency.ThreadManager;
7import de.uka.ipd.sdq.probespec.framework.garbagecollection.IRegionBasedGarbageCollector;
8import de.uka.ipd.sdq.probespec.framework.probes.IProbeStrategyRegistry;
9import de.uka.ipd.sdq.probespec.framework.utils.ProbeSetIDGenerator;
10 
11public class ProbeSpecContext {
12        
13        private IProbeStrategyRegistry probeStrategyRegistry;
14        
15        private ICalculatorFactory calculatorFactory;
16        
17        private ISampleBlackboard sampleBlackboard;
18        
19        private ThreadManager threadManager;
20        
21        private ProbeSetIDGenerator probeSetIdGenerator;
22        
23        private IRegionBasedGarbageCollector<RequestContext> blackboardGarbageCollector;
24        
25        private CalculatorRegistry calculatorRegistry;
26        
27        private Registry<PipesAndFiltersManager> pipeManagerRegisty;
28        
29        private boolean initialised;
30        
31        public ProbeSpecContext() {
32                threadManager = new ThreadManager();
33                probeSetIdGenerator = new ProbeSetIDGenerator();
34                calculatorRegistry = new CalculatorRegistry();
35                pipeManagerRegisty = new Registry<PipesAndFiltersManager>();
36        }
37        
38        public void initialise(ISampleBlackboard blackboard,
39            IProbeStrategyRegistry probeStrategyRegistry,
40            ICalculatorFactory calculatorFactory) {
41        this.sampleBlackboard = blackboard;
42        this.probeStrategyRegistry = probeStrategyRegistry;
43        this.calculatorFactory = calculatorFactory;
44        this.initialised = true;
45        }
46        
47        public Integer obtainProbeSetId(String probeSetId) {
48                return probeSetIdGenerator.obtainId(probeSetId);
49        }
50        
51        public String obtainOriginalProbeSetId(Integer probeSetId) {
52                return probeSetIdGenerator.obtainOriginalId(probeSetId);
53        }
54 
55        public IProbeStrategyRegistry getProbeStrategyRegistry() {
56            throwExceptionIfNotInitialised();
57                return probeStrategyRegistry;
58        }
59 
60        public void setProbeStrategyRegistry(
61                        IProbeStrategyRegistry probeStrategyRegistry) {
62                this.probeStrategyRegistry = probeStrategyRegistry;
63        }
64 
65        public ICalculatorFactory getCalculatorFactory() {
66            throwExceptionIfNotInitialised();
67                return calculatorFactory;
68        }
69 
70        public void setCalculatorFactory(ICalculatorFactory calculatorFactory) {
71                this.calculatorFactory = calculatorFactory;
72        }
73 
74        public ISampleBlackboard getSampleBlackboard() {
75            throwExceptionIfNotInitialised();
76                return sampleBlackboard;
77        }
78 
79        public void setSampleBlackboard(ISampleBlackboard sampleBlackboard) {
80                this.sampleBlackboard = sampleBlackboard;
81        }
82 
83        public IRegionBasedGarbageCollector<RequestContext> getBlackboardGarbageCollector() {
84                return blackboardGarbageCollector;
85        }
86 
87        public void setBlackboardGarbageCollector(
88                        IRegionBasedGarbageCollector<RequestContext> blackboardGarbageCollector) {
89                this.blackboardGarbageCollector = blackboardGarbageCollector;
90        }
91 
92        public ThreadManager getThreadManager() {
93                return threadManager;
94        }
95        
96        public CalculatorRegistry getCalculatorRegistry() {
97                return calculatorRegistry;
98        }
99        
100        public Registry<PipesAndFiltersManager> getPipeManagerRegisty() {
101            throwExceptionIfNotInitialised();
102                return pipeManagerRegisty;
103        }
104 
105        public void finish() {
106            throwExceptionIfNotInitialised();
107            
108                // stop registered threads
109                getThreadManager().stopThreads();
110                
111                // flush pipes
112                for(PipesAndFiltersManager p : pipeManagerRegisty) {
113                        p.flush();
114                }
115        }
116        
117    private void throwExceptionIfNotInitialised() {
118        if (!initialised) {
119            throw new RuntimeException("Initialise the ProbeSpecification context before using it.");
120        }
121    }
122        
123}

[all classes][de.uka.ipd.sdq.probespec.framework]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov