| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
package com.google.inject.tools.jmx; |
| 18 |
|
|
| 19 |
|
import com.google.inject.AbstractModule; |
| 20 |
|
import com.google.inject.BindingAnnotation; |
| 21 |
|
import com.google.inject.Key; |
| 22 |
|
import com.google.inject.Singleton; |
| 23 |
|
import com.google.inject.name.Names; |
| 24 |
|
import java.lang.annotation.Retention; |
| 25 |
|
import static java.lang.annotation.RetentionPolicy.RUNTIME; |
| 26 |
|
|
| 27 |
|
|
| 28 |
|
@author |
| 29 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 1 |
|
| 30 |
|
public class JmxTest { |
| 31 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
| 32 |
|
interface Foo {} |
| 33 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
| 34 |
|
static class FooImpl implements Foo {} |
| 35 |
|
|
| 36 |
|
@Singleton |
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
| 37 |
|
static class TransactionalFoo implements Foo {} |
| 38 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
| 39 |
|
static class Bar {} |
| 40 |
|
|
| 41 |
|
@BindingAnnotation @Retention(RUNTIME) |
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
| 42 |
|
@interface Transactional {} |
| 43 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 44 |
0
|
public static void main(String[] args) throws Exception {... |
| 45 |
0
|
Manager.main(new String[] { TestModule.class.getName() }); |
| 46 |
|
} |
| 47 |
|
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.2 |
|
| 48 |
|
public static class TestModule extends AbstractModule { |
| 49 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
| 50 |
0
|
protected void configure() {... |
| 51 |
0
|
bind(Foo.class).to(FooImpl.class); |
| 52 |
0
|
bind(Bar.class); |
| 53 |
0
|
bind(Foo.class) |
| 54 |
|
.annotatedWith(Transactional.class) |
| 55 |
|
.to(FooImpl.class); |
| 56 |
0
|
bindConstant().annotatedWith(Names.named("port")).to(8080); |
| 57 |
0
|
bind(Key.get(Object.class)).to(Key.get(Bar.class)); |
| 58 |
|
|
| 59 |
|
} |
| 60 |
|
} |
| 61 |
|
} |