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

COVERAGE SUMMARY FOR SOURCE FILE [PassiveResourceObservee.java]

nameclass, %method, %block, %line, %
PassiveResourceObservee.java0%   (0/1)0%   (0/6)0%   (0/71)0%   (0/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PassiveResourceObservee0%   (0/1)0%   (0/6)0%   (0/71)0%   (0/16)
PassiveResourceObservee (): void 0%   (0/1)0%   (0/8)0%   (0/3)
addObserver (IPassiveResourceSensor): void 0%   (0/1)0%   (0/6)0%   (0/2)
fireAquire (ISchedulableProcess, int): void 0%   (0/1)0%   (0/17)0%   (0/3)
fireRelease (ISchedulableProcess, int): void 0%   (0/1)0%   (0/17)0%   (0/3)
fireRequest (ISchedulableProcess, int): void 0%   (0/1)0%   (0/17)0%   (0/3)
removeObserver (IPassiveResourceSensor): void 0%   (0/1)0%   (0/6)0%   (0/2)

1package de.uka.ipd.sdq.scheduler.resources.passive;
2 
3import java.util.ArrayList;
4import java.util.List;
5 
6import de.uka.ipd.sdq.scheduler.IPassiveResource;
7import de.uka.ipd.sdq.scheduler.ISchedulableProcess;
8import de.uka.ipd.sdq.scheduler.sensors.IPassiveResourceSensor;
9 
10/**
11 * Provides observer functionality to passive resources. Normally this
12 * functionality would reside in an (abstract) super class, but for passive
13 * resources there is no such class that all resources inherit.
14 * 
15 * @author Philipp Merkle
16 * 
17 */
18public class PassiveResourceObservee {
19 
20        private List<IPassiveResourceSensor> observers;
21 
22        public PassiveResourceObservee() {
23                observers = new ArrayList<IPassiveResourceSensor>();
24        }
25 
26        /**
27         * Notifies observers that the resource has been requested.
28         */
29        public void fireRequest(ISchedulableProcess process, int num) {
30                for (IPassiveResourceSensor o : observers) {
31                        o.request(process, num);
32                }
33        }
34        
35        /**
36         * Notifies observers that the resource has been acquired.
37         */
38        public void fireAquire(ISchedulableProcess process, int num) {
39                for (IPassiveResourceSensor o : observers) {
40                        o.acquire(process, num);
41                }
42        }
43 
44        /**
45         * Notifies observers that the resource has been released.
46         */
47        public void fireRelease(ISchedulableProcess process, int num) {
48                for (IPassiveResourceSensor o : observers) {
49                        o.release(process, num);
50                }
51        }
52 
53        /**
54         * @see IPassiveResource#addObserver(IPassiveResourceSensor)
55         */
56        public void addObserver(IPassiveResourceSensor observer) {
57                observers.add(observer);
58        }
59 
60        /**
61         * @see IPassiveResource#removeObserver(IPassiveResourceSensor)
62         */
63        public void removeObserver(IPassiveResourceSensor observer) {
64                observers.remove(observer);
65        }
66 
67}

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