This repository has been archived by the owner on Feb 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 369
/
MyModule.java
56 lines (45 loc) · 1.88 KB
/
MyModule.java
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package module;
import com.feth.play.module.mail.IMailer;
import com.feth.play.module.mail.Mailer;
import com.feth.play.module.mail.Mailer.MailerFactory;
import com.feth.play.module.pa.Resolver;
import com.feth.play.module.pa.providers.openid.OpenIdAuthProvider;
import com.google.inject.AbstractModule;
import com.google.inject.assistedinject.FactoryModuleBuilder;
import play.api.Configuration;
import play.api.Environment;
import play.api.inject.Binding;
import play.api.inject.Module;
import providers.MyStupidBasicAuthProvider;
import providers.MyUsernamePasswordAuthProvider;
import scala.collection.Seq;
import service.DataInitializer;
import service.MyResolver;
import service.MyUserService;
/**
* Initial DI module.
*/
public class MyModule extends AbstractModule {
@Override
protected void configure() {
install(new FactoryModuleBuilder().implement(IMailer.class, Mailer.class).build(MailerFactory.class));
bind(Resolver.class).to(MyResolver.class);
bind(DataInitializer.class).asEagerSingleton();
bind(MyUserService.class).asEagerSingleton();
//bind(GoogleAuthProvider.class).asEagerSingleton();
//bind(FacebookAuthProvider.class).asEagerSingleton();
//bind(FoursquareAuthProvider.class).asEagerSingleton();
bind(MyUsernamePasswordAuthProvider.class).asEagerSingleton();
bind(OpenIdAuthProvider.class).asEagerSingleton();
//bind(TwitterAuthProvider.class).asEagerSingleton();
//bind(LinkedinAuthProvider.class).asEagerSingleton();
//bind(VkAuthProvider.class).asEagerSingleton();
//bind(XingAuthProvider.class).asEagerSingleton();
//bind(UntappdAuthProvider.class).asEagerSingleton();
//bind(PocketAuthProvider.class).asEagerSingleton();
//bind(GithubAuthProvider.class).asEagerSingleton();
bind(MyStupidBasicAuthProvider.class).asEagerSingleton();
//bind(SpnegoAuthProvider.class).asEagerSingleton();
//bind(EventBriteAuthProvider.class).asEagerSingleton();
}
}