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

COVERAGE SUMMARY FOR SOURCE FILE [MethodInvocable.java]

nameclass, %method, %block, %line, %
MethodInvocable.java0%   (0/1)0%   (0/4)0%   (0/27)0%   (0/8)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class MethodInvocable0%   (0/1)0%   (0/4)0%   (0/27)0%   (0/8)
MethodInvocable (Method): void 0%   (0/1)0%   (0/6)0%   (0/3)
getParameterTypes (): Class [] 0%   (0/1)0%   (0/4)0%   (0/1)
getReturnType (): Class 0%   (0/1)0%   (0/4)0%   (0/1)
invoke (Object, Invocation, ExecutorService): Object 0%   (0/1)0%   (0/13)0%   (0/3)

1package com.hammurapi.common.concurrent;
2 
3import java.lang.reflect.Method;
4import java.util.concurrent.ExecutorService;
5 
6/**
7 * Adapts java.lang.reflect.Method to Invocable.
8 * @author Pavel Vlasov
9 *
10 * @param <C>
11 */
12public class MethodInvocable<C> implements Invocable<C, Object, Object> {
13        
14        Method method;
15        
16        public MethodInvocable(Method method) {
17                super();
18                this.method = method;
19        }
20 
21        @Override
22        public Object invoke(C context, Invocation invocation, ExecutorService executorService) {
23                try {
24                        return method.invoke(context, invocation.getArguments());
25                } catch (Exception e) {
26                        throw new InvocationException(e);
27                }
28        }
29 
30        @Override
31        public Class<Object> getReturnType() {
32                return (Class<Object>) method.getReturnType();
33        }
34 
35        @Override
36        public Class<?>[] getParameterTypes() {
37                return method.getParameterTypes();
38        }
39 
40}

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