1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.onami.autobind.configuration.example.commons.plist;
17
18 import org.apache.onami.autobind.annotations.Bind;
19 import org.apache.onami.autobind.annotations.GuiceModule;
20 import org.apache.onami.autobind.configuration.StartupModule;
21 import org.apache.onami.autobind.example.starter.ExampleApplication;
22 import org.apache.onami.autobind.integrations.commons.configuration.CommonsConfigurationFeature;
23 import org.apache.onami.autobind.scanner.ClasspathScanner;
24 import org.apache.onami.autobind.scanner.PackageFilter;
25 import org.apache.onami.autobind.scanner.ScannerModule;
26 import org.apache.onami.autobind.scanner.asm.ASMClasspathScanner;
27
28 import com.google.inject.Guice;
29 import com.google.inject.Injector;
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 @Bind(multiple = true)
47 public class ExampleApp implements ExampleApplication {
48 @Override
49 public void run() {
50 StartupModule startupModule = StartupModule.create(ASMClasspathScanner.class,
51 PackageFilter.create(ExampleApp.class));
52 startupModule.addFeature(CommonsConfigurationFeature.class);
53 Injector injector = Guice.createInjector(startupModule);
54
55 System.out.println(injector.getInstance(Example.class).sayHello());
56 }
57
58 public static void main(String[] args) {
59 new ExampleApp().run();
60 }
61 }