The Configuration Foundation (Confound) library provides a lightweight yet powerful model for accessing various types of application configuration facilities via Csar.
More complex configuration may be using Confound.setDefaultConfigurationConcern(ConfigurationConcern)
with the concern of choice, as in the following example:
Confound.setDefaultConfigurationConcern(new MyConfigurationConcern());
An application can easily integrate Confound configuration support with just a few steps:
- Include the dependency
io.confound:confound:x.x.x
. - Pass configuration information to the application using an environment variable such as
FOO_BAR
or a system property such asfoo.bar
. - Call
Confound.getConfiguration().getXXX("foo.bar")
to retrieve the type of parameter you desire. This will retrieve the system propertyfoo.bar
or, if not present, the environment variableFOO_BAR
, using the appropriate case automatically.
Note: Confounded also provides a mixin interface Confounded
that allows an instance of MyClass
to call getConfiguration().getXXX("foo.bar")
.
Other Confound implementations are available via pluggable providers.
Confound is available in the Maven Central Repository in group io.confoud.
Issues tracked by JIRA.
- 0.5.0: First release.