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

COVERAGE SUMMARY FOR SOURCE FILE [OpenWorkloadUser.java]

nameclass, %method, %block, %line, %
OpenWorkloadUser.java0%   (0/1)0%   (0/4)0%   (0/125)0%   (0/34)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class OpenWorkloadUser0%   (0/1)0%   (0/4)0%   (0/125)0%   (0/34)
OpenWorkloadUser (SimuComModel, String, IScenarioRunner, String): void 0%   (0/1)0%   (0/16)0%   (0/5)
internalLifeCycle (): void 0%   (0/1)0%   (0/100)0%   (0/25)
scenarioRunner (SimuComSimProcess): void 0%   (0/1)0%   (0/5)0%   (0/2)
startUserLife (): void 0%   (0/1)0%   (0/4)0%   (0/2)

1package de.uka.ipd.sdq.simucomframework.usage;
2 
3import de.uka.ipd.sdq.probespec.framework.RequestContext;
4import de.uka.ipd.sdq.probespec.framework.garbagecollection.IRegionBasedGarbageCollector;
5import de.uka.ipd.sdq.reliability.core.FailureStatistics;
6import de.uka.ipd.sdq.simucomframework.ReliabilitySensorHelper;
7import de.uka.ipd.sdq.simucomframework.SimuComSimProcess;
8import de.uka.ipd.sdq.simucomframework.exceptions.FailureException;
9import de.uka.ipd.sdq.simucomframework.model.SimuComModel;
10 
11/**
12 * Base class for open workload users. Open workload users begin their life,
13 * execute their behaviour once, and then they die
14 * 
15 * @author Steffen Becker
16 * 
17 */
18public class OpenWorkloadUser extends SimuComSimProcess implements IUser {
19 
20        private IScenarioRunner scenarioRunner;
21        private IRegionBasedGarbageCollector<RequestContext> blackboardGarbageCollector;
22        private String usageScenarioId;
23 
24        public OpenWorkloadUser(final SimuComModel owner, final String name,
25                        final IScenarioRunner scenarioRunner, final String usageScenarioId) {
26                super(owner, name);
27                this.scenarioRunner = scenarioRunner;
28        blackboardGarbageCollector = owner.getProbeSpecContext().getBlackboardGarbageCollector();
29                this.usageScenarioId = usageScenarioId;
30        }
31 
32        /*
33         * (non-Javadoc)
34         * 
35         * @see desmoj.core.simulator.SimProcess#lifeCycle()
36         */
37        @Override
38        protected void internalLifeCycle() {
39                logger.debug(getName() + " started! I'm alive!!!");
40                // update session id
41                updateNewSessionID();
42                try {
43                        blackboardGarbageCollector.enterRegion(getRequestContext()
44                                        .rootContext());
45                        scenarioRunner(this);
46                        if (getModel().getConfiguration().getSimulateFailures()) {
47                                ReliabilitySensorHelper.recordScenarioRunResultSuccess(
48                                                getModel(), getRequestContext(),
49                                                usageScenarioId);
50                        }
51                } catch (FailureException exception) {
52                        if (getModel().getConfiguration().getSimulateFailures()) {
53                                FailureStatistics.getInstance()
54                                                .increaseUnhandledFailureCounter(
55                                                                exception.getFailureType(), currentSessionId);
56                                ReliabilitySensorHelper.recordScenarioRunResultFailure(
57                                                getModel(), exception
58                                                                .getFailureType(), getRequestContext(),
59                                                usageScenarioId);
60                        }
61                } finally {
62                        // Increase measurements counter manually as usage scenario run is
63                        // not finished:
64                        getModel().increaseMainMeasurementsCount();
65 
66                        blackboardGarbageCollector.leaveRegion(getRequestContext()
67                                        .rootContext());
68                }
69                logger.debug(getName() + " done! I'm dying!!!");
70        }
71 
72        /*
73         * (non-Javadoc)
74         * 
75         * @see
76         * de.uka.ipd.sdq.simucomframework.usage.IScenarioRunner#scenarioRunner(
77         * desmoj.core.simulator.SimProcess)
78         */
79        public void scenarioRunner(SimuComSimProcess thread) {
80                this.scenarioRunner.scenarioRunner(thread);
81        }
82 
83        /*
84         * (non-Javadoc)
85         * 
86         * @see de.uka.ipd.sdq.simucomframework.usage.IUser#startUserLife()
87         */
88        public void startUserLife() {
89                this.scheduleAt(0);
90        }
91 
92}

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