<div dir="ltr">I think everything you&#39;re describing are proposed pieces of the original config JSR.  CDI shouldn&#39;t have any business in doing things like allowing the servlet spec to conditionally register a servlet.<div><br></div><div>John<br><br><div class="gmail_quote">On Mon Feb 09 2015 at 8:09:04 AM arjan tijms &lt;<a href="mailto:arjan.tijms@gmail.com">arjan.tijms@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
On Mon, Feb 9, 2015 at 10:51 AM, Mark Struberg &lt;<a href="mailto:struberg@yahoo.de" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=struberg@yahoo.de&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">struberg@yahoo.de</a>&gt; wrote:<br>
&gt; Just curious: What is the need for swapping out overlay XMLs?<br>
<br>
There are many usecases, but one of them it having an extra Servlet in<br>
a few stages (say dev and beta) that gives tools special access to the<br>
application, or a dev filter that provides some extra options for<br>
development.<br>
<br>
Yet another case is swapping out the data-source element in say<br>
application.xml with different versions for each stage.<br>
<br>
&gt; When do you do the replacement? At deploy time? At runtime?<br>
<br>
Most deployment descriptors are processed at deploy time, so when<br>
starting up the application. You specify say a -D parameter when<br>
starting up your server that specifies the stage of your server. The<br>
runtime then chooses an overlay (e.g. extra XML fragment) based on the<br>
value of the stage.<br>
<br>
&gt;What about reconfiguration? Does it need a redeploy?<br>
<br>
The simplest case typically needs a redeploy indeed. Taking the<br>
example with the Servlets; the Servlet API only lets you add and<br>
remove Servlets and Filters during startup of the application.<br>
<br>
&gt; etc. I had to live with it in WebLogic in a project. And to me it felt like it was pretty much broken as it did require a redeployment or at least a server reboot to change the configuration. That&#39;s simply a no-go.<br>
<br>
It might have been a no-go for your particular use case, but it&#39;s not<br>
in general. It&#39;s extremely rare that you need to change the stage of a<br>
running server. Frankly, in well over 10 years of designing, coding<br>
and operating Java EE systems of various sizes, I don&#39;t think I&#39;ve<br>
ever encountered this.<br>
<br>
&gt; It also barely make sense in a time where most specs got completely rid of XML configs.<br>
<br>
Wishful thinking if you&#39;d ask me. While we surely go to more defaults<br>
and not *requiring* any upfront XML config if the user is satisfied<br>
with those defaults, Java EE is still firmly rooted in XML config.<br>
Quite a lot of configuration scenarios are contextual and not<br>
naturally expressibly in key/value pairs. I can speak for the JSF EG,<br>
and at least in JSF there is no moving to anything other than XML<br>
config (we have in fact discussed this). I&#39;m not aware of anything in<br>
the Servlet EG either. Things like a Filter definition with their<br>
nested init params or security constraints etc are just not that<br>
naturally expressed as key/value pairs. JSON perhaps, but not<br>
key/value.<br>
<br>
I strongly believe there are two main aspects of configuration that<br>
should not be confused:<br>
<br>
1. Configuring the container<br>
2. Configuring the application<br>
<br>
Where configuring is a matter of:<br>
<br>
1. Overlaying XML fragments (in practice mostly a relatively simply<br>
matter of choosing which fragment to include or not)<br>
2. Providing EL or EL-like placeholders in XML and annotations<br>
3. Providing key/values (and injecting them info the application)<br>
<br>
Both the container itself and the application can theoretically take<br>
advantage of any of these options, but it practice it seems the<br>
container configuration leans more towards 1, while the application<br>
leans more towards 3.<br>
<br>
I felt that the Java EE configuration JSR, now Tamaya, largely<br>
focussed on providing key/values and a means of injecting them into<br>
the application, and didn&#39;t think at all about deployment descriptors<br>
and placeholders in them.<br>
<br>
Kind regards,<br>
Arjan Tijms<br>
<br>
<br>
<br>
<br>
<br>
<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;&gt; If DeltaSpike Configuration already covered everything<br>
&gt;<br>
&gt;&gt; there would have been no need for Tamaya;-)<br>
&gt;<br>
&gt; The main goal is to get a JSR running. If we don&#39;t achieve this then there is really not that much benefit in Tamaya. But I am really hopeful that we DO get this done!<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; LieGrue,<br>
&gt; strub<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Friday, 6 February 2015, 13:34, Werner Keil &lt;<a href="mailto:werner.keil@gmail.com" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=werner.keil@gmail.com&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">werner.keil@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;If DeltaSpike Configuration already covered everything there would have been no need for Tamaya;-)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;On Fri, Feb 6, 2015 at 1:23 PM, arjan tijms &lt;<a href="mailto:arjan.tijms@gmail.com" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=arjan.tijms@gmail.com&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">arjan.tijms@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;Hi,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;On Fri, Feb 6, 2015 at 11:22 AM, Werner Keil &lt;<a href="mailto:werner.keil@gmail.com" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=werner.keil@gmail.com&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">werner.keil@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt; but so far JCP officials first and foremost<br>
&gt;&gt;&gt;&gt; Oracle saw either no need or no resources to do this.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;I remember some other issues being on the table, like Java SE vs Java<br>
&gt;&gt;&gt;EE and &quot;configuring the runtime&quot; vs &quot;injecting/providing values to the<br>
&gt;&gt;&gt;app&quot;.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;DeltaSpike Configuration is really great, but it&#39;s a value provider.<br>
&gt;&gt;&gt;It doesn&#39;t let you swap out or overlay deployment descriptors etc.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;Kind regards,<br>
&gt;&gt;&gt;Arjan Tijms<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Apache Tamaya was a logical result. If that could become a blue-print or<br>
&gt;&gt;&gt;&gt; initial contribution of a future JSR, let&#39;s see, maybe for EE 9. It uses<br>
&gt;&gt;&gt;&gt; other Apache projects like DeltaSpike where applicable, but may also define<br>
&gt;&gt;&gt;&gt; such annotations and types of its own, so I suggest you also share your<br>
&gt;&gt;&gt;&gt; ideas on a Tamaya mailing list or JIRA:<br>
&gt;&gt;&gt;&gt; <a href="http://tamaya.incubator.apache.org/index.html" target="_blank">http://tamaya.incubator.<u></u>apache.org/index.html</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Fri, Feb 6, 2015 at 11:02 AM, &lt;<a href="mailto:cdi-dev-request@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev-request@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev-request@lists.jboss.<u></u>org</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Send cdi-dev mailing list submissions to<br>
&gt;&gt;&gt;&gt;&gt;         <a href="mailto:cdi-dev@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; To subscribe or unsubscribe via the World Wide Web, visit<br>
&gt;&gt;&gt;&gt;&gt;         <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/<u></u>mailman/listinfo/cdi-dev</a><br>
&gt;&gt;&gt;&gt;&gt; or, via email, send a message with subject or body &#39;help&#39; to<br>
&gt;&gt;&gt;&gt;&gt;         <a href="mailto:cdi-dev-request@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev-request@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev-request@lists.jboss.<u></u>org</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; You can reach the person managing the list at<br>
&gt;&gt;&gt;&gt;&gt;         <a href="mailto:cdi-dev-owner@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev-owner@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev-owner@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; When replying, please edit your Subject line so it is more specific<br>
&gt;&gt;&gt;&gt;&gt; than &quot;Re: Contents of cdi-dev digest...&quot;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Today&#39;s Topics:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;    1. [JBoss JIRA] (CDI-504) have a standard CDI annotation like<br>
&gt;&gt;&gt;&gt;&gt;       @ConfigProperty from deltapsike (James Strachan (JIRA))<br>
&gt;&gt;&gt;&gt;&gt;    2. [JBoss JIRA] (CDI-504) have a standard CDI annotation like<br>
&gt;&gt;&gt;&gt;&gt;       @ConfigProperty from deltapsike (Martin Kouba (JIRA))<br>
&gt;&gt;&gt;&gt;&gt;    3. [JBoss JIRA] (CDI-504) have a standard CDI annotation like<br>
&gt;&gt;&gt;&gt;&gt;       @ConfigProperty from deltapsike (John Ament (JIRA))<br>
&gt;&gt;&gt;&gt;&gt;    4. [JBoss JIRA] (CDI-504) have a standard CDI annotation like<br>
&gt;&gt;&gt;&gt;&gt;       @ConfigProperty from deltapsike (James Strachan (JIRA))<br>
&gt;&gt;&gt;&gt;&gt;    5. [JBoss JIRA] (CDI-504) have a standard CDI annotation like<br>
&gt;&gt;&gt;&gt;&gt;       @ConfigProperty from deltapsike (James Strachan (JIRA))<br>
&gt;&gt;&gt;&gt;&gt;    6. [JBoss JIRA] (CDI-504) have a standard CDI annotation like<br>
&gt;&gt;&gt;&gt;&gt;       @ConfigProperty from deltapsike (James Strachan (JIRA))<br>
&gt;&gt;&gt;&gt;&gt;    7. [JBoss JIRA] (CDI-504) have a standard CDI annotation like<br>
&gt;&gt;&gt;&gt;&gt;       @ConfigProperty from deltapsike (Antoine Sabot-Durand (JIRA))<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; ------------------------------<u></u>------------------------------<u></u>----------<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Message: 1<br>
&gt;&gt;&gt;&gt;&gt; Date: Thu, 5 Feb 2015 05:01:49 -0500 (EST)<br>
&gt;&gt;&gt;&gt;&gt; From: &quot;James Strachan (JIRA)&quot; &lt;<a href="mailto:issues@jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=issues@jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">issues@jboss.org</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt; Subject: [cdi-dev] [JBoss JIRA] (CDI-504) have a standard CDI<br>
&gt;&gt;&gt;&gt;&gt;         annotation like @ConfigProperty from deltapsike<br>
&gt;&gt;&gt;&gt;&gt; To: <a href="mailto:cdi-dev@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; Message-ID:<br>
&gt;&gt;&gt;&gt;&gt;         &lt;JIRA.12562481.1423130482000.<u></u>44616.1423130509034@Atlassian.<u></u>JIRA&gt;<br>
&gt;&gt;&gt;&gt;&gt; Content-Type: text/plain; charset=UTF-8<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; James Strachan created CDI-504:<br>
&gt;&gt;&gt;&gt;&gt; ------------------------------<u></u>----<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;              Summary: have a standard CDI annotation like @ConfigProperty<br>
&gt;&gt;&gt;&gt;&gt; from deltapsike<br>
&gt;&gt;&gt;&gt;&gt;                  Key: CDI-504<br>
&gt;&gt;&gt;&gt;&gt;                  URL: <a href="https://issues.jboss.org/browse/CDI-504" target="_blank">https://issues.jboss.org/<u></u>browse/CDI-504</a><br>
&gt;&gt;&gt;&gt;&gt;              Project: CDI Specification Issues<br>
&gt;&gt;&gt;&gt;&gt;           Issue Type: Feature Request<br>
&gt;&gt;&gt;&gt;&gt;             Reporter: James Strachan<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Docker and containerisation is the new hotness; in the docker world images<br>
&gt;&gt;&gt;&gt;&gt; are static and the main way of injecting configuration is via environment<br>
&gt;&gt;&gt;&gt;&gt; variables - so that the same image can be reused but configured at run time<br>
&gt;&gt;&gt;&gt;&gt; with different configuration values. (Changing configuration files requires<br>
&gt;&gt;&gt;&gt;&gt; either different images to be created or using custom volumes which is less<br>
&gt;&gt;&gt;&gt;&gt; ideal in a containerized world).<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; So IMHO CDI should provide a simple, natural way to allow environment<br>
&gt;&gt;&gt;&gt;&gt; variables (or system properties) to be easily injected via CDI.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Delta Spike as a @ConfigProperty annotation which works very nicely<br>
&gt;&gt;&gt;&gt;&gt; <a href="http://deltaspike.apache.org/documentation/configuration.html" target="_blank">http://deltaspike.apache.org/<u></u>documentation/configuration.<u></u>html</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; you can specify a name, default value and use it on an @Inject to provide<br>
&gt;&gt;&gt;&gt;&gt; a value from env vars, system properties or provide a default.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Given how core and useful this is - it feels like it should be part of the<br>
&gt;&gt;&gt;&gt;&gt; CDI specification; its one simple annotation.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Currently deltaspike provides a way to configure different sources and<br>
&gt;&gt;&gt;&gt;&gt; whatnot which is cool; I&#39;d be happy if CDI just had a simpler annotation<br>
&gt;&gt;&gt;&gt;&gt; which was only bound to env vars / system properties.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; e.g. @EnvironmentProperty(name = &quot;envvar&quot;, deafultValue=&quot;cheese&quot;)<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; There could be debate on whether env vars or system properties should win<br>
&gt;&gt;&gt;&gt;&gt; if the same name is used for both; in a dockerized world I&#39;d prefer env vars<br>
&gt;&gt;&gt;&gt;&gt; to win but folks can always tinker with their run command to make sure they<br>
&gt;&gt;&gt;&gt;&gt; pass in env vars as system properties to work around this I guess.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; This message was sent by Atlassian JIRA<br>
&gt;&gt;&gt;&gt;&gt; (v6.3.11#6341)<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; ------------------------------<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Message: 2<br>
&gt;&gt;&gt;&gt;&gt; Date: Thu, 5 Feb 2015 10:30:50 -0500 (EST)<br>
&gt;&gt;&gt;&gt;&gt; From: &quot;Martin Kouba (JIRA)&quot; &lt;<a href="mailto:issues@jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=issues@jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">issues@jboss.org</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt; Subject: [cdi-dev] [JBoss JIRA] (CDI-504) have a standard CDI<br>
&gt;&gt;&gt;&gt;&gt;         annotation like @ConfigProperty from deltapsike<br>
&gt;&gt;&gt;&gt;&gt; To: <a href="mailto:cdi-dev@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; Message-ID:<br>
&gt;&gt;&gt;&gt;&gt;         &lt;JIRA.12562481.1423130482000.<u></u>45712.1423150250888@Atlassian.<u></u>JIRA&gt;<br>
&gt;&gt;&gt;&gt;&gt; Content-Type: text/plain; charset=UTF-8<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;     [<br>
&gt;&gt;&gt;&gt;&gt; <a href="https://issues.jboss.org/browse/CDI-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=13038005#comment-13038005" target="_blank">https://issues.jboss.org/<u></u>browse/CDI-504?page=com.<u></u>atlassian.jira.plugin.system.<u></u>issuetabpanels:comment-<u></u>tabpanel&amp;focusedCommentId=<u></u>13038005#comment-13038005</a><br>
&gt;&gt;&gt;&gt;&gt; ]<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Martin Kouba commented on CDI-504:<br>
&gt;&gt;&gt;&gt;&gt; ------------------------------<u></u>----<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; What&#39;s wrong with {{java.lang.System.<u></u>getProperty()}} and<br>
&gt;&gt;&gt;&gt;&gt; {{java.lang.System.getenv()}}? I mean the main advantage of DS Configuration<br>
&gt;&gt;&gt;&gt;&gt; is IMO the resolution mechanism and the ability to extend the set of<br>
&gt;&gt;&gt;&gt;&gt; {{ConfigSource}} s. If you only need system properties and env variables a<br>
&gt;&gt;&gt;&gt;&gt; simple producer method and qualifier (or even a simple util method) would be<br>
&gt;&gt;&gt;&gt;&gt; sufficient. In other words I see no reason to standardize this.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; have a standard CDI annotation like @ConfigProperty from deltapsike<br>
&gt;&gt;&gt;&gt;&gt; &gt; ------------------------------<u></u>------------------------------<u></u>-------<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;                 Key: CDI-504<br>
&gt;&gt;&gt;&gt;&gt; &gt;                 URL: <a href="https://issues.jboss.org/browse/CDI-504" target="_blank">https://issues.jboss.org/<u></u>browse/CDI-504</a><br>
&gt;&gt;&gt;&gt;&gt; &gt;             Project: CDI Specification Issues<br>
&gt;&gt;&gt;&gt;&gt; &gt;          Issue Type: Feature Request<br>
&gt;&gt;&gt;&gt;&gt; &gt;            Reporter: James Strachan<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; Docker and containerisation is the new hotness; in the docker world<br>
&gt;&gt;&gt;&gt;&gt; &gt; images are static and the main way of injecting configuration is via<br>
&gt;&gt;&gt;&gt;&gt; &gt; environment variables - so that the same image can be reused but configured<br>
&gt;&gt;&gt;&gt;&gt; &gt; at run time with different configuration values. (Changing configuration<br>
&gt;&gt;&gt;&gt;&gt; &gt; files requires either different images to be created or using custom volumes<br>
&gt;&gt;&gt;&gt;&gt; &gt; which is less ideal in a containerized world).<br>
&gt;&gt;&gt;&gt;&gt; &gt; So IMHO CDI should provide a simple, natural way to allow environment<br>
&gt;&gt;&gt;&gt;&gt; &gt; variables (or system properties) to be easily injected via CDI.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Delta Spike as a @ConfigProperty annotation which works very nicely<br>
&gt;&gt;&gt;&gt;&gt; &gt; <a href="http://deltaspike.apache.org/documentation/configuration.html" target="_blank">http://deltaspike.apache.org/<u></u>documentation/configuration.<u></u>html</a><br>
&gt;&gt;&gt;&gt;&gt; &gt; you can specify a name, default value and use it on an @Inject to<br>
&gt;&gt;&gt;&gt;&gt; &gt; provide a value from env vars, system properties or provide a default.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Given how core and useful this is - it feels like it should be part of<br>
&gt;&gt;&gt;&gt;&gt; &gt; the CDI specification; its one simple annotation.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Currently deltaspike provides a way to configure different sources and<br>
&gt;&gt;&gt;&gt;&gt; &gt; whatnot which is cool; I&#39;d be happy if CDI just had a simpler annotation<br>
&gt;&gt;&gt;&gt;&gt; &gt; which was only bound to env vars / system properties.<br>
&gt;&gt;&gt;&gt;&gt; &gt; e.g. @EnvironmentProperty(name = &quot;envvar&quot;, deafultValue=&quot;cheese&quot;)<br>
&gt;&gt;&gt;&gt;&gt; &gt; There could be debate on whether env vars or system properties should<br>
&gt;&gt;&gt;&gt;&gt; &gt; win if the same name is used for both; in a dockerized world I&#39;d prefer env<br>
&gt;&gt;&gt;&gt;&gt; &gt; vars to win but folks can always tinker with their run command to make sure<br>
&gt;&gt;&gt;&gt;&gt; &gt; they pass in env vars as system properties to work around this I guess.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; This message was sent by Atlassian JIRA<br>
&gt;&gt;&gt;&gt;&gt; (v6.3.11#6341)<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; ------------------------------<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Message: 3<br>
&gt;&gt;&gt;&gt;&gt; Date: Thu, 5 Feb 2015 10:34:49 -0500 (EST)<br>
&gt;&gt;&gt;&gt;&gt; From: &quot;John Ament (JIRA)&quot; &lt;<a href="mailto:issues@jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=issues@jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">issues@jboss.org</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt; Subject: [cdi-dev] [JBoss JIRA] (CDI-504) have a standard CDI<br>
&gt;&gt;&gt;&gt;&gt;         annotation like @ConfigProperty from deltapsike<br>
&gt;&gt;&gt;&gt;&gt; To: <a href="mailto:cdi-dev@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; Message-ID:<br>
&gt;&gt;&gt;&gt;&gt;         &lt;JIRA.12562481.1423130482000.<u></u>45725.1423150489341@Atlassian.<u></u>JIRA&gt;<br>
&gt;&gt;&gt;&gt;&gt; Content-Type: text/plain; charset=UTF-8<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;     [<br>
&gt;&gt;&gt;&gt;&gt; <a href="https://issues.jboss.org/browse/CDI-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=13038007#comment-13038007" target="_blank">https://issues.jboss.org/<u></u>browse/CDI-504?page=com.<u></u>atlassian.jira.plugin.system.<u></u>issuetabpanels:comment-<u></u>tabpanel&amp;focusedCommentId=<u></u>13038007#comment-13038007</a><br>
&gt;&gt;&gt;&gt;&gt; ]<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; John Ament commented on CDI-504:<br>
&gt;&gt;&gt;&gt;&gt; ------------------------------<u></u>--<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; A separate config JSR has been proposed previously to address this.  They<br>
&gt;&gt;&gt;&gt;&gt; want to see more options before trying to standardize it.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; have a standard CDI annotation like @ConfigProperty from deltapsike<br>
&gt;&gt;&gt;&gt;&gt; &gt; ------------------------------<u></u>------------------------------<u></u>-------<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;                 Key: CDI-504<br>
&gt;&gt;&gt;&gt;&gt; &gt;                 URL: <a href="https://issues.jboss.org/browse/CDI-504" target="_blank">https://issues.jboss.org/<u></u>browse/CDI-504</a><br>
&gt;&gt;&gt;&gt;&gt; &gt;             Project: CDI Specification Issues<br>
&gt;&gt;&gt;&gt;&gt; &gt;          Issue Type: Feature Request<br>
&gt;&gt;&gt;&gt;&gt; &gt;            Reporter: James Strachan<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; Docker and containerisation is the new hotness; in the docker world<br>
&gt;&gt;&gt;&gt;&gt; &gt; images are static and the main way of injecting configuration is via<br>
&gt;&gt;&gt;&gt;&gt; &gt; environment variables - so that the same image can be reused but configured<br>
&gt;&gt;&gt;&gt;&gt; &gt; at run time with different configuration values. (Changing configuration<br>
&gt;&gt;&gt;&gt;&gt; &gt; files requires either different images to be created or using custom volumes<br>
&gt;&gt;&gt;&gt;&gt; &gt; which is less ideal in a containerized world).<br>
&gt;&gt;&gt;&gt;&gt; &gt; So IMHO CDI should provide a simple, natural way to allow environment<br>
&gt;&gt;&gt;&gt;&gt; &gt; variables (or system properties) to be easily injected via CDI.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Delta Spike as a @ConfigProperty annotation which works very nicely<br>
&gt;&gt;&gt;&gt;&gt; &gt; <a href="http://deltaspike.apache.org/documentation/configuration.html" target="_blank">http://deltaspike.apache.org/<u></u>documentation/configuration.<u></u>html</a><br>
&gt;&gt;&gt;&gt;&gt; &gt; you can specify a name, default value and use it on an @Inject to<br>
&gt;&gt;&gt;&gt;&gt; &gt; provide a value from env vars, system properties or provide a default.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Given how core and useful this is - it feels like it should be part of<br>
&gt;&gt;&gt;&gt;&gt; &gt; the CDI specification; its one simple annotation.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Currently deltaspike provides a way to configure different sources and<br>
&gt;&gt;&gt;&gt;&gt; &gt; whatnot which is cool; I&#39;d be happy if CDI just had a simpler annotation<br>
&gt;&gt;&gt;&gt;&gt; &gt; which was only bound to env vars / system properties.<br>
&gt;&gt;&gt;&gt;&gt; &gt; e.g. @EnvironmentProperty(name = &quot;envvar&quot;, deafultValue=&quot;cheese&quot;)<br>
&gt;&gt;&gt;&gt;&gt; &gt; There could be debate on whether env vars or system properties should<br>
&gt;&gt;&gt;&gt;&gt; &gt; win if the same name is used for both; in a dockerized world I&#39;d prefer env<br>
&gt;&gt;&gt;&gt;&gt; &gt; vars to win but folks can always tinker with their run command to make sure<br>
&gt;&gt;&gt;&gt;&gt; &gt; they pass in env vars as system properties to work around this I guess.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; This message was sent by Atlassian JIRA<br>
&gt;&gt;&gt;&gt;&gt; (v6.3.11#6341)<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; ------------------------------<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Message: 4<br>
&gt;&gt;&gt;&gt;&gt; Date: Thu, 5 Feb 2015 10:39:49 -0500 (EST)<br>
&gt;&gt;&gt;&gt;&gt; From: &quot;James Strachan (JIRA)&quot; &lt;<a href="mailto:issues@jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=issues@jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">issues@jboss.org</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt; Subject: [cdi-dev] [JBoss JIRA] (CDI-504) have a standard CDI<br>
&gt;&gt;&gt;&gt;&gt;         annotation like @ConfigProperty from deltapsike<br>
&gt;&gt;&gt;&gt;&gt; To: <a href="mailto:cdi-dev@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; Message-ID:<br>
&gt;&gt;&gt;&gt;&gt;         &lt;JIRA.12562481.1423130482000.<u></u>45741.1423150789541@Atlassian.<u></u>JIRA&gt;<br>
&gt;&gt;&gt;&gt;&gt; Content-Type: text/plain; charset=UTF-8<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;     [<br>
&gt;&gt;&gt;&gt;&gt; <a href="https://issues.jboss.org/browse/CDI-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=13038012#comment-13038012" target="_blank">https://issues.jboss.org/<u></u>browse/CDI-504?page=com.<u></u>atlassian.jira.plugin.system.<u></u>issuetabpanels:comment-<u></u>tabpanel&amp;focusedCommentId=<u></u>13038012#comment-13038012</a><br>
&gt;&gt;&gt;&gt;&gt; ]<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; James Strachan commented on CDI-504:<br>
&gt;&gt;&gt;&gt;&gt; ------------------------------<u></u>------<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; @Resource is supported - injecting values from JNDI. I don&#39;t see why<br>
&gt;&gt;&gt;&gt;&gt; injecting values (with a default value) from the environment isn&#39;t also<br>
&gt;&gt;&gt;&gt;&gt; supported too. There&#39;s a Java API for JNDI too so folks could look stuff up<br>
&gt;&gt;&gt;&gt;&gt; in JNDI by hand and do the type conversions - but we&#39;ve injection for those<br>
&gt;&gt;&gt;&gt;&gt; values.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Its also much cleaner code and can easily deal generically with type<br>
&gt;&gt;&gt;&gt;&gt; conversion to long/double/float/date etc.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Compare:<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt; @Inject Foo(int bar, ...) {<br>
&gt;&gt;&gt;&gt;&gt; bar = System.getenv(&quot;FOO&quot;);<br>
&gt;&gt;&gt;&gt;&gt; if (bar == null) {<br>
&gt;&gt;&gt;&gt;&gt;    bar = &quot;someDefault&quot;;<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;&gt; // now convert to a String with error handling....<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt; to just:<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt; @Inject Foo(@Environment(&quot;FOO&quot;, &quot;someDefault&quot;) int bar, ...) {<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Also by using an annotation it means its very easy to generate<br>
&gt;&gt;&gt;&gt;&gt; documentation and tooling. (e.g. using APT you can know what all the<br>
&gt;&gt;&gt;&gt;&gt; environment variables are used by CDI; either to report on demand or to<br>
&gt;&gt;&gt;&gt;&gt; generate user documentation).<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; have a standard CDI annotation like @ConfigProperty from deltapsike<br>
&gt;&gt;&gt;&gt;&gt; &gt; ------------------------------<u></u>------------------------------<u></u>-------<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;                 Key: CDI-504<br>
&gt;&gt;&gt;&gt;&gt; &gt;                 URL: <a href="https://issues.jboss.org/browse/CDI-504" target="_blank">https://issues.jboss.org/<u></u>browse/CDI-504</a><br>
&gt;&gt;&gt;&gt;&gt; &gt;             Project: CDI Specification Issues<br>
&gt;&gt;&gt;&gt;&gt; &gt;          Issue Type: Feature Request<br>
&gt;&gt;&gt;&gt;&gt; &gt;            Reporter: James Strachan<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; Docker and containerisation is the new hotness; in the docker world<br>
&gt;&gt;&gt;&gt;&gt; &gt; images are static and the main way of injecting configuration is via<br>
&gt;&gt;&gt;&gt;&gt; &gt; environment variables - so that the same image can be reused but configured<br>
&gt;&gt;&gt;&gt;&gt; &gt; at run time with different configuration values. (Changing configuration<br>
&gt;&gt;&gt;&gt;&gt; &gt; files requires either different images to be created or using custom volumes<br>
&gt;&gt;&gt;&gt;&gt; &gt; which is less ideal in a containerized world).<br>
&gt;&gt;&gt;&gt;&gt; &gt; So IMHO CDI should provide a simple, natural way to allow environment<br>
&gt;&gt;&gt;&gt;&gt; &gt; variables (or system properties) to be easily injected via CDI.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Delta Spike as a @ConfigProperty annotation which works very nicely<br>
&gt;&gt;&gt;&gt;&gt; &gt; <a href="http://deltaspike.apache.org/documentation/configuration.html" target="_blank">http://deltaspike.apache.org/<u></u>documentation/configuration.<u></u>html</a><br>
&gt;&gt;&gt;&gt;&gt; &gt; you can specify a name, default value and use it on an @Inject to<br>
&gt;&gt;&gt;&gt;&gt; &gt; provide a value from env vars, system properties or provide a default.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Given how core and useful this is - it feels like it should be part of<br>
&gt;&gt;&gt;&gt;&gt; &gt; the CDI specification; its one simple annotation.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Currently deltaspike provides a way to configure different sources and<br>
&gt;&gt;&gt;&gt;&gt; &gt; whatnot which is cool; I&#39;d be happy if CDI just had a simpler annotation<br>
&gt;&gt;&gt;&gt;&gt; &gt; which was only bound to env vars / system properties.<br>
&gt;&gt;&gt;&gt;&gt; &gt; e.g. @EnvironmentProperty(name = &quot;envvar&quot;, deafultValue=&quot;cheese&quot;)<br>
&gt;&gt;&gt;&gt;&gt; &gt; There could be debate on whether env vars or system properties should<br>
&gt;&gt;&gt;&gt;&gt; &gt; win if the same name is used for both; in a dockerized world I&#39;d prefer env<br>
&gt;&gt;&gt;&gt;&gt; &gt; vars to win but folks can always tinker with their run command to make sure<br>
&gt;&gt;&gt;&gt;&gt; &gt; they pass in env vars as system properties to work around this I guess.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; This message was sent by Atlassian JIRA<br>
&gt;&gt;&gt;&gt;&gt; (v6.3.11#6341)<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; ------------------------------<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Message: 5<br>
&gt;&gt;&gt;&gt;&gt; Date: Thu, 5 Feb 2015 10:49:49 -0500 (EST)<br>
&gt;&gt;&gt;&gt;&gt; From: &quot;James Strachan (JIRA)&quot; &lt;<a href="mailto:issues@jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=issues@jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">issues@jboss.org</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt; Subject: [cdi-dev] [JBoss JIRA] (CDI-504) have a standard CDI<br>
&gt;&gt;&gt;&gt;&gt;         annotation like @ConfigProperty from deltapsike<br>
&gt;&gt;&gt;&gt;&gt; To: <a href="mailto:cdi-dev@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; Message-ID:<br>
&gt;&gt;&gt;&gt;&gt;         &lt;JIRA.12562481.1423130482000.<u></u>45763.1423151389408@Atlassian.<u></u>JIRA&gt;<br>
&gt;&gt;&gt;&gt;&gt; Content-Type: text/plain; charset=UTF-8<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;     [<br>
&gt;&gt;&gt;&gt;&gt; <a href="https://issues.jboss.org/browse/CDI-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=13038012#comment-13038012" target="_blank">https://issues.jboss.org/<u></u>browse/CDI-504?page=com.<u></u>atlassian.jira.plugin.system.<u></u>issuetabpanels:comment-<u></u>tabpanel&amp;focusedCommentId=<u></u>13038012#comment-13038012</a><br>
&gt;&gt;&gt;&gt;&gt; ]<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; James Strachan edited comment on CDI-504 at 2/5/15 10:49 AM:<br>
&gt;&gt;&gt;&gt;&gt; ------------------------------<u></u>------------------------------<u></u>-<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; @Resource is supported - injecting values from JNDI. I don&#39;t see why<br>
&gt;&gt;&gt;&gt;&gt; injecting values (with a default value) from the environment isn&#39;t also<br>
&gt;&gt;&gt;&gt;&gt; supported too. There&#39;s a Java API for JNDI too so folks could look stuff up<br>
&gt;&gt;&gt;&gt;&gt; in JNDI by hand and do the type conversions - but we&#39;ve injection for those<br>
&gt;&gt;&gt;&gt;&gt; values.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Its also much cleaner code and can easily deal generically with type<br>
&gt;&gt;&gt;&gt;&gt; conversion to long/double/float/date etc.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Compare:<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt; @Inject Foo(int bar, ...) {<br>
&gt;&gt;&gt;&gt;&gt; bar = System.getenv(&quot;FOO&quot;);<br>
&gt;&gt;&gt;&gt;&gt; if (bar == null) {<br>
&gt;&gt;&gt;&gt;&gt;    bar = &quot;someDefault&quot;;<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;&gt; // now convert the String to an int with nice error handling and<br>
&gt;&gt;&gt;&gt;&gt; reporting....<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt; to just:<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt; @Inject Foo(@Environment(&quot;FOO&quot;, &quot;someDefault&quot;) int bar, ...) {<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Also by using an annotation it means its very easy to generate<br>
&gt;&gt;&gt;&gt;&gt; documentation and tooling. (e.g. using APT you can know what all the<br>
&gt;&gt;&gt;&gt;&gt; environment variables are used by CDI; either to report on demand or to<br>
&gt;&gt;&gt;&gt;&gt; generate user documentation).<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; was (Author: jastrachan):<br>
&gt;&gt;&gt;&gt;&gt; @Resource is supported - injecting values from JNDI. I don&#39;t see why<br>
&gt;&gt;&gt;&gt;&gt; injecting values (with a default value) from the environment isn&#39;t also<br>
&gt;&gt;&gt;&gt;&gt; supported too. There&#39;s a Java API for JNDI too so folks could look stuff up<br>
&gt;&gt;&gt;&gt;&gt; in JNDI by hand and do the type conversions - but we&#39;ve injection for those<br>
&gt;&gt;&gt;&gt;&gt; values.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Its also much cleaner code and can easily deal generically with type<br>
&gt;&gt;&gt;&gt;&gt; conversion to long/double/float/date etc.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Compare:<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt; @Inject Foo(int bar, ...) {<br>
&gt;&gt;&gt;&gt;&gt; bar = System.getenv(&quot;FOO&quot;);<br>
&gt;&gt;&gt;&gt;&gt; if (bar == null) {<br>
&gt;&gt;&gt;&gt;&gt;    bar = &quot;someDefault&quot;;<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;&gt; // now convert to a String with error handling....<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt; to just:<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt; @Inject Foo(@Environment(&quot;FOO&quot;, &quot;someDefault&quot;) int bar, ...) {<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Also by using an annotation it means its very easy to generate<br>
&gt;&gt;&gt;&gt;&gt; documentation and tooling. (e.g. using APT you can know what all the<br>
&gt;&gt;&gt;&gt;&gt; environment variables are used by CDI; either to report on demand or to<br>
&gt;&gt;&gt;&gt;&gt; generate user documentation).<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; have a standard CDI annotation like @ConfigProperty from deltapsike<br>
&gt;&gt;&gt;&gt;&gt; &gt; ------------------------------<u></u>------------------------------<u></u>-------<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;                 Key: CDI-504<br>
&gt;&gt;&gt;&gt;&gt; &gt;                 URL: <a href="https://issues.jboss.org/browse/CDI-504" target="_blank">https://issues.jboss.org/<u></u>browse/CDI-504</a><br>
&gt;&gt;&gt;&gt;&gt; &gt;             Project: CDI Specification Issues<br>
&gt;&gt;&gt;&gt;&gt; &gt;          Issue Type: Feature Request<br>
&gt;&gt;&gt;&gt;&gt; &gt;            Reporter: James Strachan<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; Docker and containerisation is the new hotness; in the docker world<br>
&gt;&gt;&gt;&gt;&gt; &gt; images are static and the main way of injecting configuration is via<br>
&gt;&gt;&gt;&gt;&gt; &gt; environment variables - so that the same image can be reused but configured<br>
&gt;&gt;&gt;&gt;&gt; &gt; at run time with different configuration values. (Changing configuration<br>
&gt;&gt;&gt;&gt;&gt; &gt; files requires either different images to be created or using custom volumes<br>
&gt;&gt;&gt;&gt;&gt; &gt; which is less ideal in a containerized world).<br>
&gt;&gt;&gt;&gt;&gt; &gt; So IMHO CDI should provide a simple, natural way to allow environment<br>
&gt;&gt;&gt;&gt;&gt; &gt; variables (or system properties) to be easily injected via CDI.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Delta Spike as a @ConfigProperty annotation which works very nicely<br>
&gt;&gt;&gt;&gt;&gt; &gt; <a href="http://deltaspike.apache.org/documentation/configuration.html" target="_blank">http://deltaspike.apache.org/<u></u>documentation/configuration.<u></u>html</a><br>
&gt;&gt;&gt;&gt;&gt; &gt; you can specify a name, default value and use it on an @Inject to<br>
&gt;&gt;&gt;&gt;&gt; &gt; provide a value from env vars, system properties or provide a default.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Given how core and useful this is - it feels like it should be part of<br>
&gt;&gt;&gt;&gt;&gt; &gt; the CDI specification; its one simple annotation.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Currently deltaspike provides a way to configure different sources and<br>
&gt;&gt;&gt;&gt;&gt; &gt; whatnot which is cool; I&#39;d be happy if CDI just had a simpler annotation<br>
&gt;&gt;&gt;&gt;&gt; &gt; which was only bound to env vars / system properties.<br>
&gt;&gt;&gt;&gt;&gt; &gt; e.g. @EnvironmentProperty(name = &quot;envvar&quot;, deafultValue=&quot;cheese&quot;)<br>
&gt;&gt;&gt;&gt;&gt; &gt; There could be debate on whether env vars or system properties should<br>
&gt;&gt;&gt;&gt;&gt; &gt; win if the same name is used for both; in a dockerized world I&#39;d prefer env<br>
&gt;&gt;&gt;&gt;&gt; &gt; vars to win but folks can always tinker with their run command to make sure<br>
&gt;&gt;&gt;&gt;&gt; &gt; they pass in env vars as system properties to work around this I guess.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; This message was sent by Atlassian JIRA<br>
&gt;&gt;&gt;&gt;&gt; (v6.3.11#6341)<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; ------------------------------<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Message: 6<br>
&gt;&gt;&gt;&gt;&gt; Date: Thu, 5 Feb 2015 10:50:49 -0500 (EST)<br>
&gt;&gt;&gt;&gt;&gt; From: &quot;James Strachan (JIRA)&quot; &lt;<a href="mailto:issues@jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=issues@jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">issues@jboss.org</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt; Subject: [cdi-dev] [JBoss JIRA] (CDI-504) have a standard CDI<br>
&gt;&gt;&gt;&gt;&gt;         annotation like @ConfigProperty from deltapsike<br>
&gt;&gt;&gt;&gt;&gt; To: <a href="mailto:cdi-dev@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; Message-ID:<br>
&gt;&gt;&gt;&gt;&gt;         &lt;JIRA.12562481.1423130482000.<u></u>45773.1423151449139@Atlassian.<u></u>JIRA&gt;<br>
&gt;&gt;&gt;&gt;&gt; Content-Type: text/plain; charset=UTF-8<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;     [<br>
&gt;&gt;&gt;&gt;&gt; <a href="https://issues.jboss.org/browse/CDI-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=13038012#comment-13038012" target="_blank">https://issues.jboss.org/<u></u>browse/CDI-504?page=com.<u></u>atlassian.jira.plugin.system.<u></u>issuetabpanels:comment-<u></u>tabpanel&amp;focusedCommentId=<u></u>13038012#comment-13038012</a><br>
&gt;&gt;&gt;&gt;&gt; ]<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; James Strachan edited comment on CDI-504 at 2/5/15 10:50 AM:<br>
&gt;&gt;&gt;&gt;&gt; ------------------------------<u></u>------------------------------<u></u>-<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; @Resource is supported - injecting values from JNDI. I don&#39;t see why<br>
&gt;&gt;&gt;&gt;&gt; injecting values (with a default value) from the environment isn&#39;t also<br>
&gt;&gt;&gt;&gt;&gt; supported too. There&#39;s a Java API for JNDI too so folks could look stuff up<br>
&gt;&gt;&gt;&gt;&gt; in JNDI by hand and do the type conversions - but we&#39;ve injection for those<br>
&gt;&gt;&gt;&gt;&gt; values.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Its also much cleaner code and can easily deal generically with type<br>
&gt;&gt;&gt;&gt;&gt; conversion to long/double/float/date etc.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Compare:<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt; int bar;<br>
&gt;&gt;&gt;&gt;&gt; @Inject Foo() {<br>
&gt;&gt;&gt;&gt;&gt; barText = System.getenv(&quot;FOO&quot;);<br>
&gt;&gt;&gt;&gt;&gt; if (barText == null) {<br>
&gt;&gt;&gt;&gt;&gt;    barText = &quot;someDefault&quot;;<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;&gt; // now convert the String to an int with nice error handling and<br>
&gt;&gt;&gt;&gt;&gt; reporting....<br>
&gt;&gt;&gt;&gt;&gt; bar = someConvertCode(barText);<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt; to just:<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt; @Inject Foo(@Environment(&quot;FOO&quot;, &quot;someDefault&quot;) int bar, ...) {<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Note that in the second case, folks could use the constructor explicitly<br>
&gt;&gt;&gt;&gt;&gt; without being bound to environment variables too; much cleaner, more modular<br>
&gt;&gt;&gt;&gt;&gt; code.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Also by using an annotation it means its very easy to generate<br>
&gt;&gt;&gt;&gt;&gt; documentation and tooling. (e.g. using APT you can know what all the<br>
&gt;&gt;&gt;&gt;&gt; environment variables are used by CDI; either to report on demand or to<br>
&gt;&gt;&gt;&gt;&gt; generate user documentation).<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; was (Author: jastrachan):<br>
&gt;&gt;&gt;&gt;&gt; @Resource is supported - injecting values from JNDI. I don&#39;t see why<br>
&gt;&gt;&gt;&gt;&gt; injecting values (with a default value) from the environment isn&#39;t also<br>
&gt;&gt;&gt;&gt;&gt; supported too. There&#39;s a Java API for JNDI too so folks could look stuff up<br>
&gt;&gt;&gt;&gt;&gt; in JNDI by hand and do the type conversions - but we&#39;ve injection for those<br>
&gt;&gt;&gt;&gt;&gt; values.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Its also much cleaner code and can easily deal generically with type<br>
&gt;&gt;&gt;&gt;&gt; conversion to long/double/float/date etc.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Compare:<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt; @Inject Foo(int bar, ...) {<br>
&gt;&gt;&gt;&gt;&gt; bar = System.getenv(&quot;FOO&quot;);<br>
&gt;&gt;&gt;&gt;&gt; if (bar == null) {<br>
&gt;&gt;&gt;&gt;&gt;    bar = &quot;someDefault&quot;;<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;&gt; // now convert the String to an int with nice error handling and<br>
&gt;&gt;&gt;&gt;&gt; reporting....<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt; to just:<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt; @Inject Foo(@Environment(&quot;FOO&quot;, &quot;someDefault&quot;) int bar, ...) {<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;&gt; {code}<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Also by using an annotation it means its very easy to generate<br>
&gt;&gt;&gt;&gt;&gt; documentation and tooling. (e.g. using APT you can know what all the<br>
&gt;&gt;&gt;&gt;&gt; environment variables are used by CDI; either to report on demand or to<br>
&gt;&gt;&gt;&gt;&gt; generate user documentation).<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; have a standard CDI annotation like @ConfigProperty from deltapsike<br>
&gt;&gt;&gt;&gt;&gt; &gt; ------------------------------<u></u>------------------------------<u></u>-------<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;                 Key: CDI-504<br>
&gt;&gt;&gt;&gt;&gt; &gt;                 URL: <a href="https://issues.jboss.org/browse/CDI-504" target="_blank">https://issues.jboss.org/<u></u>browse/CDI-504</a><br>
&gt;&gt;&gt;&gt;&gt; &gt;             Project: CDI Specification Issues<br>
&gt;&gt;&gt;&gt;&gt; &gt;          Issue Type: Feature Request<br>
&gt;&gt;&gt;&gt;&gt; &gt;            Reporter: James Strachan<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; Docker and containerisation is the new hotness; in the docker world<br>
&gt;&gt;&gt;&gt;&gt; &gt; images are static and the main way of injecting configuration is via<br>
&gt;&gt;&gt;&gt;&gt; &gt; environment variables - so that the same image can be reused but configured<br>
&gt;&gt;&gt;&gt;&gt; &gt; at run time with different configuration values. (Changing configuration<br>
&gt;&gt;&gt;&gt;&gt; &gt; files requires either different images to be created or using custom volumes<br>
&gt;&gt;&gt;&gt;&gt; &gt; which is less ideal in a containerized world).<br>
&gt;&gt;&gt;&gt;&gt; &gt; So IMHO CDI should provide a simple, natural way to allow environment<br>
&gt;&gt;&gt;&gt;&gt; &gt; variables (or system properties) to be easily injected via CDI.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Delta Spike as a @ConfigProperty annotation which works very nicely<br>
&gt;&gt;&gt;&gt;&gt; &gt; <a href="http://deltaspike.apache.org/documentation/configuration.html" target="_blank">http://deltaspike.apache.org/<u></u>documentation/configuration.<u></u>html</a><br>
&gt;&gt;&gt;&gt;&gt; &gt; you can specify a name, default value and use it on an @Inject to<br>
&gt;&gt;&gt;&gt;&gt; &gt; provide a value from env vars, system properties or provide a default.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Given how core and useful this is - it feels like it should be part of<br>
&gt;&gt;&gt;&gt;&gt; &gt; the CDI specification; its one simple annotation.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Currently deltaspike provides a way to configure different sources and<br>
&gt;&gt;&gt;&gt;&gt; &gt; whatnot which is cool; I&#39;d be happy if CDI just had a simpler annotation<br>
&gt;&gt;&gt;&gt;&gt; &gt; which was only bound to env vars / system properties.<br>
&gt;&gt;&gt;&gt;&gt; &gt; e.g. @EnvironmentProperty(name = &quot;envvar&quot;, deafultValue=&quot;cheese&quot;)<br>
&gt;&gt;&gt;&gt;&gt; &gt; There could be debate on whether env vars or system properties should<br>
&gt;&gt;&gt;&gt;&gt; &gt; win if the same name is used for both; in a dockerized world I&#39;d prefer env<br>
&gt;&gt;&gt;&gt;&gt; &gt; vars to win but folks can always tinker with their run command to make sure<br>
&gt;&gt;&gt;&gt;&gt; &gt; they pass in env vars as system properties to work around this I guess.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; This message was sent by Atlassian JIRA<br>
&gt;&gt;&gt;&gt;&gt; (v6.3.11#6341)<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; ------------------------------<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Message: 7<br>
&gt;&gt;&gt;&gt;&gt; Date: Fri, 6 Feb 2015 05:02:49 -0500 (EST)<br>
&gt;&gt;&gt;&gt;&gt; From: &quot;Antoine Sabot-Durand (JIRA)&quot; &lt;<a href="mailto:issues@jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=issues@jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">issues@jboss.org</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt; Subject: [cdi-dev] [JBoss JIRA] (CDI-504) have a standard CDI<br>
&gt;&gt;&gt;&gt;&gt;         annotation like @ConfigProperty from deltapsike<br>
&gt;&gt;&gt;&gt;&gt; To: <a href="mailto:cdi-dev@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; Message-ID:<br>
&gt;&gt;&gt;&gt;&gt;         &lt;JIRA.12562481.1423130482000.<u></u>47108.1423216969246@Atlassian.<u></u>JIRA&gt;<br>
&gt;&gt;&gt;&gt;&gt; Content-Type: text/plain; charset=UTF-8<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;     [<br>
&gt;&gt;&gt;&gt;&gt; <a href="https://issues.jboss.org/browse/CDI-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=13038271#comment-13038271" target="_blank">https://issues.jboss.org/<u></u>browse/CDI-504?page=com.<u></u>atlassian.jira.plugin.system.<u></u>issuetabpanels:comment-<u></u>tabpanel&amp;focusedCommentId=<u></u>13038271#comment-13038271</a><br>
&gt;&gt;&gt;&gt;&gt; ]<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Antoine Sabot-Durand commented on CDI-504:<br>
&gt;&gt;&gt;&gt;&gt; ------------------------------<u></u>------------<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; James, I don&#39;t get what&#39;s the problem with using DeltaSpike config<br>
&gt;&gt;&gt;&gt;&gt; solution?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; have a standard CDI annotation like @ConfigProperty from deltapsike<br>
&gt;&gt;&gt;&gt;&gt; &gt; ------------------------------<u></u>------------------------------<u></u>-------<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;                 Key: CDI-504<br>
&gt;&gt;&gt;&gt;&gt; &gt;                 URL: <a href="https://issues.jboss.org/browse/CDI-504" target="_blank">https://issues.jboss.org/<u></u>browse/CDI-504</a><br>
&gt;&gt;&gt;&gt;&gt; &gt;             Project: CDI Specification Issues<br>
&gt;&gt;&gt;&gt;&gt; &gt;          Issue Type: Feature Request<br>
&gt;&gt;&gt;&gt;&gt; &gt;            Reporter: James Strachan<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; Docker and containerisation is the new hotness; in the docker world<br>
&gt;&gt;&gt;&gt;&gt; &gt; images are static and the main way of injecting configuration is via<br>
&gt;&gt;&gt;&gt;&gt; &gt; environment variables - so that the same image can be reused but configured<br>
&gt;&gt;&gt;&gt;&gt; &gt; at run time with different configuration values. (Changing configuration<br>
&gt;&gt;&gt;&gt;&gt; &gt; files requires either different images to be created or using custom volumes<br>
&gt;&gt;&gt;&gt;&gt; &gt; which is less ideal in a containerized world).<br>
&gt;&gt;&gt;&gt;&gt; &gt; So IMHO CDI should provide a simple, natural way to allow environment<br>
&gt;&gt;&gt;&gt;&gt; &gt; variables (or system properties) to be easily injected via CDI.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Delta Spike as a @ConfigProperty annotation which works very nicely<br>
&gt;&gt;&gt;&gt;&gt; &gt; <a href="http://deltaspike.apache.org/documentation/configuration.html" target="_blank">http://deltaspike.apache.org/<u></u>documentation/configuration.<u></u>html</a><br>
&gt;&gt;&gt;&gt;&gt; &gt; you can specify a name, default value and use it on an @Inject to<br>
&gt;&gt;&gt;&gt;&gt; &gt; provide a value from env vars, system properties or provide a default.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Given how core and useful this is - it feels like it should be part of<br>
&gt;&gt;&gt;&gt;&gt; &gt; the CDI specification; its one simple annotation.<br>
&gt;&gt;&gt;&gt;&gt; &gt; Currently deltaspike provides a way to configure different sources and<br>
&gt;&gt;&gt;&gt;&gt; &gt; whatnot which is cool; I&#39;d be happy if CDI just had a simpler annotation<br>
&gt;&gt;&gt;&gt;&gt; &gt; which was only bound to env vars / system properties.<br>
&gt;&gt;&gt;&gt;&gt; &gt; e.g. @EnvironmentProperty(name = &quot;envvar&quot;, deafultValue=&quot;cheese&quot;)<br>
&gt;&gt;&gt;&gt;&gt; &gt; There could be debate on whether env vars or system properties should<br>
&gt;&gt;&gt;&gt;&gt; &gt; win if the same name is used for both; in a dockerized world I&#39;d prefer env<br>
&gt;&gt;&gt;&gt;&gt; &gt; vars to win but folks can always tinker with their run command to make sure<br>
&gt;&gt;&gt;&gt;&gt; &gt; they pass in env vars as system properties to work around this I guess.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; This message was sent by Atlassian JIRA<br>
&gt;&gt;&gt;&gt;&gt; (v6.3.11#6341)<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; ------------------------------<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; ______________________________<u></u>_________________<br>
&gt;&gt;&gt;&gt;&gt; cdi-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt; <a href="mailto:cdi-dev@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/<u></u>mailman/listinfo/cdi-dev</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Note that for all code provided on this list, the provider licenses the<br>
&gt;&gt;&gt;&gt;&gt; code under the Apache License, Version 2<br>
&gt;&gt;&gt;&gt;&gt; (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">http://www.apache.org/<u></u>licenses/LICENSE-2.0.html</a>).  For all other ideas<br>
&gt;&gt;&gt;&gt;&gt; provided on this list, the provider waives all patent and other intellectual<br>
&gt;&gt;&gt;&gt;&gt; property rights inherent in such information.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; End of cdi-dev Digest, Vol 51, Issue 9<br>
&gt;&gt;&gt;&gt;&gt; ******************************<u></u>********<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; ______________________________<u></u>_________________<br>
&gt;&gt;&gt;&gt; cdi-dev mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:cdi-dev@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/<u></u>mailman/listinfo/cdi-dev</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Note that for all code provided on this list, the provider licenses the code<br>
&gt;&gt;&gt;&gt; under the Apache License, Version 2<br>
&gt;&gt;&gt;&gt; (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">http://www.apache.org/<u></u>licenses/LICENSE-2.0.html</a>). For all other ideas<br>
&gt;&gt;&gt;&gt; provided on this list, the provider waives all patent and other intellectual<br>
&gt;&gt;&gt;&gt; property rights inherent in such information.<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;____________________________<u></u>___________________<br>
&gt;&gt;cdi-dev mailing list<br>
&gt;&gt;<a href="mailto:cdi-dev@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/<u></u>mailman/listinfo/cdi-dev</a><br>
&gt;&gt;<br>
&gt;&gt;Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">http://www.apache.org/<u></u>licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
&gt;&gt;<br>
&gt;&gt;<br>
<br>
______________________________<u></u>_________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/<u></u>mailman/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">http://www.apache.org/<u></u>licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
</blockquote></div></div></div>