diff options
Diffstat (limited to 'src/org/traccar/MainModule.java')
-rw-r--r-- | src/org/traccar/MainModule.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/org/traccar/MainModule.java b/src/org/traccar/MainModule.java index 99f665134..6c66a90b8 100644 --- a/src/org/traccar/MainModule.java +++ b/src/org/traccar/MainModule.java @@ -15,12 +15,34 @@ */ package org.traccar; +import com.fasterxml.jackson.databind.ObjectMapper; import com.google.inject.AbstractModule; +import com.google.inject.Provides; +import com.google.inject.assistedinject.FactoryModuleBuilder; +import org.traccar.database.IdentityManager; + +import javax.ws.rs.client.Client; public class MainModule extends AbstractModule { + @Provides + public static ObjectMapper getObjectMapper() { + return Context.getObjectMapper(); + } + + @Provides + public static IdentityManager getIdentityManager() { + return Context.getIdentityManager(); + } + + @Provides + public static Client getClient() { + return Context.getClient(); + } + @Override protected void configure() { + install(new FactoryModuleBuilder().build(WebDataHandler.Factory.class)); } } |