-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDemoModule.java
More file actions
32 lines (27 loc) · 823 Bytes
/
Copy pathDemoModule.java
File metadata and controls
32 lines (27 loc) · 823 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 by.andd3dfx.guice;
import by.andd3dfx.guice.util.Communicator;
import by.andd3dfx.guice.util.DefaultCommunicatorImpl;
import by.andd3dfx.guice.util.Spawner;
import by.andd3dfx.guice.util.SpawnerImpl;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
/**
* Guice module that provides bindings for message and count used in {@link Greeter}.
*/
public class DemoModule extends AbstractModule {
@Provides
@Count
static Integer provideCount() {
return 3;
}
@Provides
@Message
static String provideMessage() {
return "hello world";
}
@Override
protected void configure() {
bind(Communicator.class).to(DefaultCommunicatorImpl.class);
bind(Spawner.class).to(SpawnerImpl.class);
}
}