ConfigureMe - Java OpenSource Configuration Utility
ConfigureMe is a configuration utility for really simple auto configuring of the java objects. It focuses on a different configurations of the same object in a different environments (e.g. for deploying case it can be: dev, test and prod system). ConfigureMe configures POJOs, based on annotations. Currently it supports json, xml and .properties files.
- Automatic type safe configuration via annotations
- Support for cascading environments
- Automatic re-configuration of the configurable objects on configuration (file) change
- One-to-one relation between a configuration and a configurable object
- Overview of all configuration options for a given configurable object at a glance
- Low load time, low memory footprint
Environments is the core feature of the ConfigureMe, that gives possybility to predefine properties values for the different "using situations".
Situations (actually, anything that have a common criteria) mean something like:
- Different servers
- Different users
- Different countries
- Different groups of users
- Different moods (even )
Environments supports any level cascading. The main cascading principles are:
- Property value from the lower level overrides property (same) value from the higher level.
- If requested environment not exists, values will be taken from the higher level environment (root is the default environment).
Dependency (update version to the latest)
Direct download from nexus
Getting Started Example
Let’s have a look how to use ConfigureMe on a small live example. Suppose we develop an application, witch will request some external server(s) for the users photos (image files). Also we want to configure some other properties around the photos, for example - maximum size or the uploaded photo files.
With ConfigureMe our configuration file may looks like:
All magic starts when we try to run client application with the different environments, witch is usually configurable via the system property, named “configureme.defaultEnvironment”:
We see that client will have a different properties values for the different environments (like systems in our example) and so it will behave differently.
In this article you saw only a part of the ConfigureMe (OpenSource Configuration Utility) capabilities, but I hope it was enough to understand what is ConfigureMe and how it can be useful in your dev-work.
Everything else (how to get, more docs, and more examples) may be found exactly on this ConfigureMe project documentation page: http://www.configureme.org
ConfigureMe project page on java.net: http://configureme.dev.java.net
Any questions, want’s to join, feedback and requests for futures are very welcome here: firstname.lastname@example.org