[JBoss JIRA] (CDI-504) have a standard CDI annotation like @ConfigProperty from deltapsike
by James Strachan (JIRA)
James Strachan created CDI-504:
----------------------------------
Summary: have a standard CDI annotation like @ConfigProperty from deltapsike
Key: CDI-504
URL: https://issues.jboss.org/browse/CDI-504
Project: CDI Specification Issues
Issue Type: Feature Request
Reporter: James Strachan
Docker and containerisation is the new hotness; in the docker world images are static and the main way of injecting configuration is via environment variables - so that the same image can be reused but configured at run time with different configuration values. (Changing configuration files requires either different images to be created or using custom volumes which is less ideal in a containerized world).
So IMHO CDI should provide a simple, natural way to allow environment variables (or system properties) to be easily injected via CDI.
Delta Spike as a @ConfigProperty annotation which works very nicely
http://deltaspike.apache.org/documentation/configuration.html
you can specify a name, default value and use it on an @Inject to provide a value from env vars, system properties or provide a default.
Given how core and useful this is - it feels like it should be part of the CDI specification; its one simple annotation.
Currently deltaspike provides a way to configure different sources and whatnot which is cool; I'd be happy if CDI just had a simpler annotation which was only bound to env vars / system properties.
e.g. @EnvironmentProperty(name = "envvar", deafultValue="cheese")
There could be debate on whether env vars or system properties should win if the same name is used for both; in a dockerized world I'd prefer env vars to win but folks can always tinker with their run command to make sure they pass in env vars as system properties to work around this I guess.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 1 month
Re: [cdi-dev] Clarify scopes and serialization
by Werner Keil
What about TomEE?
After all it's Java EE 6 certified:
http://www.oracle.com/technetwork/java/javaee/overview/compatibility-jsp-...
So as Mark mentioned briefly, there is a requirement by the Servlet spec,
so I assume it is either always on or at least on by default (otherwise
a TomEE "tweaked" like that would no longer be Java EE compliant;-)
Tomcat itself was never certified.
Werner
On Tue, Feb 3, 2015 at 9:39 AM, <cdi-dev-request(a)lists.jboss.org> wrote:
> Send cdi-dev mailing list submissions to
> cdi-dev(a)lists.jboss.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.jboss.org/mailman/listinfo/cdi-dev
> or, via email, send a message with subject or body 'help' to
> cdi-dev-request(a)lists.jboss.org
>
> You can reach the person managing the list at
> cdi-dev-owner(a)lists.jboss.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of cdi-dev digest..."
>
>
> Today's Topics:
>
> 1. Re: Clarify scopes and serialization (Mark Struberg)
> 2. Re: Clarify scopes and serialization (Romain Manni-Bucau)
> 3. Re: Clarify scopes and serialization (Mark Struberg)
> 4. Re: Clarify scopes and serialization (Romain Manni-Bucau)
> 5. Re: Async events. We need ideas to improve CDI-499
> (Jozef Hartinger)
>
>
> ----------------------------------------------------------------------
>
>
> Message: 4
> Date: Mon, 2 Feb 2015 16:50:44 +0100
> From: Romain Manni-Bucau <rmannibucau(a)gmail.com>
> Subject: Re: [cdi-dev] Clarify scopes and serialization
> To: Mark Struberg <struberg(a)yahoo.de>
> Cc: cdi-dev <cdi-dev(a)lists.jboss.org>
> Message-ID:
> <CACLE=
> 7MUGeq_bgdx0W_hPT-15-9ae_XdD3kab0P3vE4YHftKRg(a)mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> in a standard tomcat yes but not in most of embedded ones...and that's
> not the point anyway
>
>
> Romain Manni-Bucau
> @rmannibucau
> http://www.tomitribe.com
> http://rmannibucau.wordpress.com
> https://github.com/rmannibucau
>
>
> 2015-02-02 16:50 GMT+01:00 Mark Struberg <struberg(a)yahoo.de>:
> > but you HAVE to manually switch it off. By _default_ the serialization
> is on...
> >
> > LieGrue,
> > strub
> >
> >
> >
> >
> >> On Monday, 2 February 2015, 16:42, Romain Manni-Bucau <
> rmannibucau(a)gmail.com> wrote:
> >> > @Mark: that's not true. 1) you can switch it off + I mainly spoke of
> >> embedded case where it is true in 80% of cases
> >>
> >>
> >> Romain Manni-Bucau
> >> @rmannibucau
> >> http://www.tomitribe.com
> >> http://rmannibucau.wordpress.com
> >> https://github.com/rmannibucau
> >>
> >>
> >>
> >> 2015-02-02 16:38 GMT+01:00 Mark Struberg <struberg(a)yahoo.de>:
> >>> Romain, that's not true. Tomcat by default ALWAYS serializes the
> >> session at shutdown! Even if you don't have a cluster set up. This is
> also
> >> required by the Servlets spec...
> >>>
> >>> LieGrue,
> >>> strub
> >>>
> >>>
> >>>
> _______________________________________________
> cdi-dev mailing list
> cdi-dev(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the
> code under the Apache License, Version 2 (
> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> provided on this list, the provider waives all patent and other
> intellectual property rights inherent in such information.
>
> End of cdi-dev Digest, Vol 51, Issue 4
> **************************************
>
10 years, 1 month