dev@glassfish.java.net

Re: global setting

From: Tom Mueller <Tom.Mueller_at_oracle.com>
Date: Thu, 04 Apr 2013 10:35:17 -0500

Normally, system properties are not used to configure subsystems.
Rather, there should be an config bean for that subsystem with
attributes for the configurable features.

As to where it should go, this depends on the thing being configured.
Is this something that can be configured for an individual server or a
cluster of servers? Then the a sub-element of <config> is the way to
go. The config bean can be declarated as a ConfigExtension so that it
can be placed under the <config> element. If the value has to be set
once for the entire domain, then a <domain> subelement would be
appropriate (extend DomainExtension).

The config modularity one pager describes how to do this. The element
does not need to be added to the domain.xml in the template because it
can be configured at runtime as needed when the module is used.

What interface are you planning to use to set the value?

Tom



On 4/4/13 9:54 AM, JJ Snyder wrote:
> I need a way to set a global option for CDI. My plan is to use a
> system property defined in domain.xml like:
>
> <system-property description="Disable Implicit CDI."
> name="DISABLE_IMPLICIT_CDI" value="false"></system-property>
>
> Is this the preferred method for global configuration? If so which
> "<config>" element does this belong under?
> <config name="server-config">
> <config name="default-config">
>
> I assume it's under "server-config"...
>
>
> There is no other CDI configuration planned at this time.
>
> thanks,
> JJ