EMMA Coverage Report (generated Thu Jan 20 11:39:44 EST 2011)
[all classes][com.hammurapi.common.concurrent]

COVERAGE SUMMARY FOR SOURCE FILE [CallerThreadExecutorService.java]

nameclass, %method, %block, %line, %
CallerThreadExecutorService.java100% (1/1)38%  (3/8)55%  (11/20)55%  (6/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CallerThreadExecutorService100% (1/1)38%  (3/8)55%  (11/20)55%  (6/11)
awaitTermination (long, TimeUnit): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
isShutdown (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
isTerminated (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
shutdown (): void 0%   (0/1)0%   (0/1)0%   (0/1)
shutdownNow (): List 0%   (0/1)0%   (0/2)0%   (0/1)
<static initializer> 100% (1/1)100% (5/5)100% (2/2)
CallerThreadExecutorService (): void 100% (1/1)100% (3/3)100% (2/2)
execute (Runnable): void 100% (1/1)100% (3/3)100% (2/2)

1package com.hammurapi.common.concurrent;
2 
3import java.util.Collections;
4import java.util.List;
5import java.util.concurrent.AbstractExecutorService;
6import java.util.concurrent.ExecutorService;
7import java.util.concurrent.TimeUnit;
8 
9/**
10 * Executes all tasks in the current thread. This executor service can be used in situations when
11 * inherently asynchronous class shall operate in synchronous mode. 
12 * @author Pavel Vlasov
13 *
14 */
15public class CallerThreadExecutorService extends AbstractExecutorService {
16        
17        private CallerThreadExecutorService() {
18                
19        }
20        
21        public final static ExecutorService INSTANCE = new CallerThreadExecutorService();
22 
23        @Override
24        public void shutdown() {
25                // Nothing to do
26        }
27 
28        @Override
29        public List<Runnable> shutdownNow() {
30                return Collections.emptyList();
31        }
32 
33        @Override
34        public boolean isShutdown() {
35                return false;
36        }
37 
38        @Override
39        public boolean isTerminated() {
40                return false;
41        }
42 
43        @Override
44        public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
45                return true;
46        }
47 
48        @Override
49        public void execute(Runnable command) {
50                command.run();
51        }
52 
53}

[all classes][com.hammurapi.common.concurrent]
EMMA 2.0.5312 EclEmma Fix 2 (C) Vladimir Roubtsov