dev@glassfish.java.net

Re: hk2 enhancement

From: Sahoo <Sahoo_at_Sun.COM>
Date: Wed, 24 Mar 2010 07:29:54 -0700

System properties make it harder for code to be embedded. We have
something called StartupContext and that's what HK2 should be using to
obtain any property values. Did I
misunderstand your original question?

Thanks,
Sahoo

Justin Lee wrote:
> In grizzly, especially, we have several cases where we don't define
> default values on configuration properties because we need to be able
> to support various system properties. If the config value is null, we
> check System.getProperties(). If both are null, we apply a hard coded
> default value. This is cumbersome and problematic and makes it hard
> to document what the default value actually is. It also What I
> propose is to extend the Attribute annotation to take an option system
> property name and perhaps some precedence. If the value of the
> attribute is null (or is equal to the default value), the system
> property is checked to see if it's been set. If the attribute uses
> the default value and the system property is set, the precedence value
> is used to determine which value is applied.
>
> As distasteful as using system properties is, we need to support them
> in a number of areas for legacy support reasons. This enhancement
> would allow us to declaratively define what system properties are
> supported where. This would be massive gain in both code needed to
> support such arrangements and documentation for our users. What do
> you think?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>