1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.groovy.internal; |
21 |
|
|
22 |
|
import java.util.HashMap; |
23 |
|
import java.util.Map; |
24 |
|
|
25 |
|
import javax.inject.Inject; |
26 |
|
import javax.inject.Named; |
27 |
|
import javax.inject.Singleton; |
28 |
|
|
29 |
|
import org.codehaus.groovy.control.customizers.ASTTransformationCustomizer; |
30 |
|
import org.codehaus.groovy.control.customizers.CompilationCustomizer; |
31 |
|
import org.xwiki.component.annotation.Component; |
32 |
|
import org.xwiki.groovy.GroovyCompilationCustomizer; |
33 |
|
import org.xwiki.groovy.TimedInterruptCustomizerConfiguration; |
34 |
|
|
35 |
|
import groovy.transform.TimedInterrupt; |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
@link |
40 |
|
|
41 |
|
@version |
42 |
|
@since |
43 |
|
|
44 |
|
@Component |
45 |
|
@Named("timedInterrupt") |
46 |
|
@Singleton |
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.33 |
|
47 |
|
public class TimedInterruptGroovyCompilationCustomizer implements GroovyCompilationCustomizer |
48 |
|
{ |
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
@Inject |
53 |
|
private TimedInterruptCustomizerConfiguration configuration; |
54 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
55 |
1 |
@Override... |
56 |
|
public CompilationCustomizer createCustomizer() |
57 |
|
{ |
58 |
1 |
Map<String, Object> parameters = new HashMap<String, Object>(); |
59 |
1 |
parameters.put("value", this.configuration.getTimeout()); |
60 |
1 |
return new ASTTransformationCustomizer(parameters, TimedInterrupt.class); |
61 |
|
} |
62 |
|
} |