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

COVERAGE SUMMARY FOR SOURCE FILE [QueueingConfigurationSwitch.java]

nameclass, %method, %block, %line, %
QueueingConfigurationSwitch.java0%   (0/1)0%   (0/3)0%   (0/56)0%   (0/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class QueueingConfigurationSwitch0%   (0/1)0%   (0/3)0%   (0/56)0%   (0/12)
QueueingConfigurationSwitch (IRunQueue, IInstanceSelector, SchedulingFactory,... 0%   (0/1)0%   (0/15)0%   (0/6)
caseMultipleQueueConfiguration (MultipleQueueConfiguration): IQueueingStrategy 0%   (0/1)0%   (0/26)0%   (0/4)
caseSingleQueueConfiguration (SingleQueueConfiguration): IQueueingStrategy 0%   (0/1)0%   (0/15)0%   (0/2)

1package de.uka.ipd.sdq.scheduler.factory;
2 
3import scheduler.configuration.MultipleQueueConfiguration;
4import scheduler.configuration.SingleQueueConfiguration;
5import scheduler.configuration.util.ConfigurationSwitch;
6import de.uka.ipd.sdq.scheduler.loaddistribution.IInstanceSelector;
7import de.uka.ipd.sdq.scheduler.loaddistribution.IProcessSelector;
8import de.uka.ipd.sdq.scheduler.loaddistribution.balancers.AbstractLoadBalancer;
9import de.uka.ipd.sdq.scheduler.queueing.IQueueingStrategy;
10import de.uka.ipd.sdq.scheduler.queueing.IRunQueue;
11import de.uka.ipd.sdq.scheduler.queueing.strategies.MultipleQueuesStrategy;
12import de.uka.ipd.sdq.scheduler.queueing.strategies.SingleQueueStrategy;
13import de.uka.ipd.sdq.scheduler.resources.active.SimActiveResource;
14import de.uka.ipd.sdq.scheduler.strategy.impl.AbstractScheduler;
15 
16public class QueueingConfigurationSwitch extends ConfigurationSwitch<IQueueingStrategy> {
17        
18        
19        private IInstanceSelector instance_selector;
20        private IRunQueue runqueue_prototype;
21        private SimActiveResource resource;
22        private SchedulingFactory factory;
23 
24        public QueueingConfigurationSwitch(IRunQueue runqueue_prototype, IInstanceSelector instance_selector, SchedulingFactory factory, SimActiveResource resource){
25                this.instance_selector = instance_selector;
26                this.runqueue_prototype = runqueue_prototype;
27                this.factory = factory;
28                this.resource = resource;
29        }
30        
31        @Override
32        public IQueueingStrategy caseMultipleQueueConfiguration(
33                        MultipleQueueConfiguration configuration) {
34                AbstractLoadBalancer load_balancer = (AbstractLoadBalancer)factory.createLoadBalancer(configuration.getLoadBalancing());
35                MultipleQueuesStrategy strategy = new MultipleQueuesStrategy(resource.getInstanceList(), runqueue_prototype, instance_selector, load_balancer, configuration.isInFrontWhenBalancing());
36                load_balancer.setQueueHolder(strategy);
37                return strategy;
38        }
39        
40        @Override
41        public IQueueingStrategy caseSingleQueueConfiguration(SingleQueueConfiguration configuration) {
42                IProcessSelector processSelector = factory.createProcessSelector(configuration.getProcessSelection());
43                return new SingleQueueStrategy(runqueue_prototype, processSelector, instance_selector);
44        }
45}

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