forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppModule.java
More file actions
32 lines (28 loc) · 792 Bytes
/
Copy pathAppModule.java
File metadata and controls
32 lines (28 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package pi.docker;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
/**
* Created by xiaofeiwu on 2016/12/1.
*/
public class AppModule {
private static AppModule instance = null;
private Injector injector;
protected AppModule() {
// Exists only to defeat instantiation.
injector= Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
}
});
}
public static AppModule getInstance() {
if(instance == null) {
instance = new AppModule();
}
return instance;
}
public static DockerImageMeta meta(){
return getInstance().injector.getInstance(DockerImageMeta.class);
}
}