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 [ResourceFailedEvent.java]

nameclass, %method, %block, %line, %
ResourceFailedEvent.java0%   (0/1)0%   (0/6)0%   (0/37)0%   (0/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ResourceFailedEvent0%   (0/1)0%   (0/6)0%   (0/37)0%   (0/12)
ResourceFailedEvent (SimuComModel, String): void 0%   (0/1)0%   (0/5)0%   (0/2)
eventRoutine (AbstractScheduledResource): void 0%   (0/1)0%   (0/18)0%   (0/4)
getRepairedEvent (): ResourceRepairedEvent 0%   (0/1)0%   (0/3)0%   (0/1)
getResource (): AbstractScheduledResource 0%   (0/1)0%   (0/3)0%   (0/1)
setRepairedEvent (ResourceRepairedEvent): void 0%   (0/1)0%   (0/4)0%   (0/2)
setResource (AbstractScheduledResource): void 0%   (0/1)0%   (0/4)0%   (0/2)

1package de.uka.ipd.sdq.simucomframework.resources;
2 
3import de.uka.ipd.sdq.simucomframework.model.SimuComModel;
4import de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEventDelegator;
5 
6/**
7 * Represents a failure of an AbstractScheduledResource.
8 * 
9 * After the occurrence of the failure event, the resource remains unavailable
10 * until the next repair event occurs.
11 * 
12 * @author brosch
13 * 
14 */
15public class ResourceFailedEvent extends AbstractSimEventDelegator<AbstractScheduledResource> {
16 
17        /**
18         * The resource that this event belongs to.
19         */
20        private AbstractScheduledResource resource;
21 
22        /**
23         * The corresponding repair event.
24         */
25        private ResourceRepairedEvent repairedEvent;
26 
27        /**
28         * The constructor.
29         * 
30         * @param model
31         *            the owner model
32         * @param name
33         *            the name of the event
34         */
35        public ResourceFailedEvent(final SimuComModel model, final String name) {
36                super(model, name);
37        }
38 
39        /*
40         * (non-Javadoc)
41         * @see de.uka.ipd.sdq.simucomframework.abstractSimEngine.SimEvent#eventRoutine(de.uka.ipd.sdq.simucomframework.abstractSimEngine.IEntityDelegate)
42         */
43        public void eventRoutine(AbstractScheduledResource who) {
44                resource.setAvailable(false);
45                if (this.getModel().getSimulationControl().isRunning()) {
46                        repairedEvent.schedule(resource, resource.getRepairTime());
47                }
48        }
49 
50        /**
51         * Retrieves the resource corresponding to the event.
52         * 
53         * @return the corresponding resource
54         */
55        public AbstractScheduledResource getResource() {
56                return resource;
57        }
58 
59        /**
60         * Sets the resource corresponding to the event.
61         * 
62         * @param resource
63         *            the resource to set
64         */
65        public void setResource(final AbstractScheduledResource resource) {
66                this.resource = resource;
67        }
68 
69        /**
70         * Retrieves the corresponding repair event.
71         * 
72         * @return the repair event
73         */
74        public ResourceRepairedEvent getRepairedEvent() {
75                return repairedEvent;
76        }
77 
78        /**
79         * Sets the corresponding repair event.
80         * 
81         * @param repairedEvent
82         *            the repair event
83         */
84        public void setRepairedEvent(final ResourceRepairedEvent repairedEvent) {
85                this.repairedEvent = repairedEvent;
86        }
87}

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