Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are possible lightweight Java configuration libraries for handling complex configuration? [closed]

I have a need for processing a relatively complex set of configuration parameters for a java application. The requirements are roughly:

  • Nested configuration values with lists, maps, etc. - not just plain key/value pairs
  • Multiple configuration files where later configuration files can intelligently override settings from earlier configuration files.
  • Multiple references to the same configured item from different places
  • Inheritable configured objects, so anew object can copy configuration from a previous object can just change specific things
  • Very little code needed for a new configuration options - the optimal would be to just add an @Configurable annotation to a field, or something similar

Now, I know that Spring fulfills all of these in a certain way. However, it has some disadvantages, though none fatal:

  • Spring is not really optimized as a configuration language, as it is somewhat more concerned about dependency injection
  • The XML configuration files are more meant to be shipped inside a JAR file and not modified by the end user, with all the configurable properties referenced via a separate properties file or similar - where as I need the configuration file to be complete and easily end-user modifiable
  • Spring configuration is somewhat tedious when there are online configuration refreshes without terminating ongoing connections and when there needs to be separate configuration checking primitives that need to validate a configuration fully, but not actually do anything

So, I am asking, can you think of any alternatives that would fulfill my requirements?

I sort of like YamlBeans, but it is lacking a few features.

like image 928
Nakedible Avatar asked Mar 31 '11 06:03

Nakedible


People also ask

What is cfg4j?

cfg4j ("configuration for Java") is a configuration library for Java distributed apps (and more).

What is common configuration?

Common Configuration Enumeration or “CCE” means a set of unique identifiers to security-related system configuration issues in order to improve workflow by facilitating fast and accurate correlation of configuration data across multiple information sources and tools.


1 Answers

This one looks interesting, though I have to admit I haven't used it:

http://owner.aeonbits.org

like image 69
Nathan Perrier Avatar answered Oct 13 '22 21:10

Nathan Perrier