Search in sources :

Example 16 with ConfigContext

use of com.nexblocks.authguard.config.ConfigContext in project AuthGuard by AuthGuard.

the class ConfigBinder method configure.

@Override
protected void configure() {
    configContext.subContexts().forEach(subContext -> {
        bind(ConfigContext.class).annotatedWith(Names.named(subContext)).toInstance(configContext.getSubContext(subContext));
    });
    // if nothing was
    bind(ConfigContext.class).annotatedWith(Named.class).toInstance(new EmptyConfigContext());
    bind(ConfigContext.class).toInstance(configContext);
}
Also used : Named(com.google.inject.name.Named) EmptyConfigContext(com.nexblocks.authguard.config.EmptyConfigContext) EmptyConfigContext(com.nexblocks.authguard.config.EmptyConfigContext) ConfigContext(com.nexblocks.authguard.config.ConfigContext)

Aggregations

ConfigContext (com.nexblocks.authguard.config.ConfigContext)16 Test (org.junit.jupiter.api.Test)5 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)4 JacksonConfigContext (com.nexblocks.authguard.config.JacksonConfigContext)4 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)3 ServiceMapperImpl (com.nexblocks.authguard.service.mappers.ServiceMapperImpl)3 Injector (com.google.inject.Injector)2 OtpRepository (com.nexblocks.authguard.dal.cache.OtpRepository)2 MessageBus (com.nexblocks.authguard.emb.MessageBus)2 EmailProvider (com.nexblocks.authguard.external.email.EmailProvider)2 ExchangeService (com.nexblocks.authguard.service.ExchangeService)2 BeforeAll (org.junit.jupiter.api.BeforeAll)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 CreationException (com.google.inject.CreationException)1 Guice (com.google.inject.Guice)1 ProvisionException (com.google.inject.ProvisionException)1 Named (com.google.inject.name.Named)1 com.nexblocks.authguard.bindings (com.nexblocks.authguard.bindings)1 BootstrapRunner (com.nexblocks.authguard.bootstrap.BootstrapRunner)1 EmptyConfigContext (com.nexblocks.authguard.config.EmptyConfigContext)1