properties - Apache Java Configuration API - configuration profiles (inheritance)? -
properties - Apache Java Configuration API - configuration profiles (inheritance)? -
when working zend framework, used have .ini
configuration files, this:
[production] setting1 = abc setting2 = def [development : production] setting1 = ghi
and when turned on development
application profile setting1
had value of ghi
, whereas in prdouction mode abc
. is possible define such inherited settings in apache commons configuration?
i know can define multiple configuration files , create compositeconfiuration them, how tell application should include specific files in different modes? not have thought how set these application profiles yet setting called profile
should work me.
if possible, not want split settings in multiple files.
i can't find info how should done in java.
apache configuration reads config options file memory info structure. besides variable expansion, there no farther post processing default. options are:
put options in default config , utilize individual "delta" configs overwrite defaults. merge these individual files compositeconfiuration
.
this design follows java's inheritance model: base of operations type extend overwrite value , add together new ones.
create post processor takes huge config , turns new config preferred merging rules applied.
create helper object values key in config. allow merging @ lookup time.
java properties apache-commons-config
Comments
Post a Comment