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

COVERAGE SUMMARY FOR SOURCE FILE [PassiveResourceTimeoutEvent.java]

nameclass, %method, %block, %line, %
PassiveResourceTimeoutEvent.java0%   (0/1)0%   (0/5)0%   (0/47)0%   (0/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PassiveResourceTimeoutEvent0%   (0/1)0%   (0/5)0%   (0/47)0%   (0/16)
<static initializer> 0%   (0/1)0%   (0/3)0%   (0/2)
PassiveResourceTimeoutEvent (SchedulerModel, SimSimpleFairPassiveResource, Si... 0%   (0/1)0%   (0/12)0%   (0/4)
eventRoutine (SimpleWaitingProcess): void 0%   (0/1)0%   (0/26)0%   (0/8)
getProcess (): SimpleWaitingProcess 0%   (0/1)0%   (0/3)0%   (0/1)
getResource (): SimSimpleFairPassiveResource 0%   (0/1)0%   (0/3)0%   (0/1)

1package de.uka.ipd.sdq.simucomframework.resources;
2 
3import de.uka.ipd.sdq.reliability.core.FailureStatistics;
4import de.uka.ipd.sdq.scheduler.SchedulerModel;
5import de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEventDelegator;
6 
7/**
8 * This event indicates a timeout of a process waiting at a passive resource.
9 * 
10 * @author brosch
11 * 
12 */
13public class PassiveResourceTimeoutEvent extends AbstractSimEventDelegator<SimpleWaitingProcess> {
14 
15        /**
16         * The waiting process.
17         */
18        private SimpleWaitingProcess process;
19 
20        /**
21         * The resource.
22         */
23        private SimSimpleFairPassiveResource resource;
24 
25        /**
26         * Creates a new timeout event.
27         * 
28         * @param model
29         *            the SimuCom model
30         * @param resource
31         *            the involved passive resource
32         * @param process
33         *            the waiting process
34         */
35        public PassiveResourceTimeoutEvent(final SchedulerModel model,
36                        final SimSimpleFairPassiveResource resource,
37                        final SimpleWaitingProcess process) {
38                super(model, resource.getName());
39                this.resource = resource;
40                this.process = process;
41        }
42 
43        private static int count = 0;
44 
45        /*
46         * (non-Javadoc)
47         * 
48         * @see
49         * de.uka.ipd.sdq.simucomframework.abstractSimEngine.SimEvent#eventRoutine
50         * (de.uka.ipd.sdq.simucomframework.abstractSimEngine.IEntityDelegate)
51         */
52        public void eventRoutine(SimpleWaitingProcess who) {
53 
54                // Check if the process is still waiting:
55                if (!resource.isWaiting(process)) {
56                        return;
57                }
58 
59                // Trigger a timeout of the waiting process:
60                resource.remove(process);
61                process.getProcess().timeout(
62                                FailureStatistics.getInstance().getResourceTimeoutFailureType(
63                                                resource.getAssemblyContextID(),
64                                                resource.getPassiveResourceID()).getId());
65        }
66 
67        /**
68         * Retrieves the waiting process.
69         * 
70         * @return the waiting process
71         */
72        public SimpleWaitingProcess getProcess() {
73                return process;
74        }
75 
76        /**
77         * Retrieves the passive resource.
78         * 
79         * @return the passive resource
80         */
81        public SimSimpleFairPassiveResource getResource() {
82                return resource;
83        }
84 
85}

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