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

COVERAGE SUMMARY FOR SOURCE FILE [PassiveResource.java]

nameclass, %method, %block, %line, %
PassiveResource.java0%   (0/1)0%   (0/5)0%   (0/61)0%   (0/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PassiveResource0%   (0/1)0%   (0/5)0%   (0/61)0%   (0/15)
<static initializer> 0%   (0/1)0%   (0/5)0%   (0/3)
PassiveResource (int, String): void 0%   (0/1)0%   (0/13)0%   (0/4)
acquire (): void 0%   (0/1)0%   (0/25)0%   (0/4)
getType (): String 0%   (0/1)0%   (0/3)0%   (0/1)
release (): void 0%   (0/1)0%   (0/15)0%   (0/3)

1package de.uka.ipd.sdq.prototype.framework.strategies;
2 
3import java.util.concurrent.Semaphore;
4 
5import org.apache.log4j.Logger;
6 
7public class PassiveResource {
8        
9        private static Logger logger = 
10                Logger.getLogger(PassiveResource.class.getName());
11        
12        private Semaphore semaphore;
13        private String type;
14        
15        public PassiveResource(int capacity, String type){
16                this.semaphore = new Semaphore(capacity, true);
17                this.type = type;
18        }
19 
20        public void acquire(){
21                logger.debug("Acquiring "+type);
22                this.semaphore.acquireUninterruptibly();
23                logger.debug(type+" aquired");
24        }
25        
26        public void release(){
27                this.semaphore.release();
28                logger.debug(type+" released");
29        }
30 
31        public String getType() {
32                return type;
33        }
34        
35}

[all classes][de.uka.ipd.sdq.prototype.framework.strategies]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov