Skip to content
This repository has been archived by the owner on May 8, 2022. It is now read-only.

Latest commit

 

History

History
46 lines (37 loc) · 707 Bytes

README.md

File metadata and controls

46 lines (37 loc) · 707 Bytes

Guice Config

Reading externalized primitive configurations in Guice apps.

Usage

Load configs:

// Java Preferences
Module conf = PrefesModule.system("/path/to/prefs");

// JNDI
Module conf = new JndiModule();

// Properties (file)
Module conf = new PropsModule(properties);

Install them:

protected void configure() {
    install(conf);
    ...
}

Or push them:

Modules.override(mainModule).with(config);

Then use them:

    @Inject @Named("foo")
    private String foo;

Maven

<dependency>
    <groupId>me.shakiba.guice-config</groupId>
    <artifactId>guice-config</artifactId>
    <version>0.0.4</version>
</dependency>