I did reread the original post again and I think I had a different picture in
mind.
In my reply, I was thinking about the following use case:
mycomp.somebatch.error.emails=a@mycomp,b@mycomp,c@mycomp
List<String> emails =
ConfigResolver.resolve("mycomp.somebatch.error.emails).getListValue();
or
mycomp.someprocess.retry.times=30, 60,180,600
List<Integer> retryTimes =
ConfirResolver.resolve("mycomp.someprocess.retry.times").as(Integer.class).getListValue();
But those 'lists' are something different than Thomas Lustig meant I think
(after reading again).
This is close to what I had as 'lookupChain' in my Config JSR proposal.
It is basically the same like ProjectStageAware and PropertyAware, but
abstracted out to be attribute independent.
Something like
String val = ConfigProvider.resolve("some.key).
withLookupChain("${deltaspike.ProjectStage}", "${profile_key}, "postgres")
.getValue();
This will kind of go through the matrix in a bitwise fashion and check for
existing post-fixes like described in [1]. Just fully dynamic.
If the value contains a ${} then it is a variable which will get evaluated
first. Without it's just a hardcoded postfix.
makes sense?
LieGrue,
strub
[1]
https://deltaspike.apache.org/javadoc/1.7.1/org/apache/deltaspike/core/api/config/ConfigResolver.html#getPropertyAwarePropertyValue-java.lang.String-java.lang.String-
> Am 25.03.2017 um 05:15 schrieb John D. Ament <[email protected]>:
>
> Hi,
>
> I'm not sure that config is necessarily the same as a preferences API.
> Specifically, you want to store use specific attribute values, if I'm
> understanding you right, correct?
>
> John
>
> On Fri, Mar 24, 2017 at 2:02 PM Mark Struberg <[email protected]>
> wrote:
>
>> Hi folks!
>>
>> I've implemented a comma separated List handling already, just didn't
>> commit it yet.
>> Will try to push it over the weekend and put it up for review.
>>
>> LieGrue,
>> strub
>>
>>
>>> Am 23.03.2017 um 09:04 schrieb [email protected]:
>>>
>>> This could be a great feature. After a small research there are only
>>> native Java Preferences ( hate that ) or self made. But it is very common
>>> and fits in DS suite in my opinion.
>>>
>>> Paweł
>>>
>>>
>>>
>>>
>>> Od: Thomas Lustig <[email protected]>
>>> Do: [email protected]
>>> Data: 2017-03-19 10:14
>>> Temat: Howto use DeltaSpike Configuration Module for userprofiles
>>>
>>>
>>>
>>> Dear Community,
>>>
>>> I am really fond of using Deltaspike configuration module to configure my
>>> JEE application.
>>> I would like to store also data that is specific to application users in
>> a
>>> kind of profile.
>>>
>>> config_key profile_key config_value
>>>
>> ------------------------------------------------------------------------------------------------------
>>> john favorite_menues my_books,my_posts
>>> eliza favorite_menues my_posts,my_music
>>>
>>>
>>> Are there some best practises how to implement such an additional
>>> dimension
>>> (profile_key) using deltaspike?
>>>
>>> Thanking you very much in advance for helping me
>>>
>>> kind regards
>>>
>>> Tom
>>>
>>
>>