You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by Charles Moulliard <cm...@gmail.com> on 2012/06/13 08:52:30 UTC

Question about JSE example

Hi,

The example
org.apache.deltaspike.example.beanmanagement.SimpleBeanLookupExample allows
to get a CDI container. It starts by invoking the following method
CdiContainerLoader.getCdiContainer() which will call --> the ServiceLoader (
ServiceLoader<CdiContainer> cdiContainerLoader =
ServiceLoader.load(CdiContainer.class);).

As there is no file into the directory META-INF/services and the project is
simply started with mvn -Pexamples, how the SimpleBeanLookupExample knows
which implementation (OWB, Weld) to be used.

Regards,

Charles 


--
View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Question-about-JSE-example-tp4652732.html
Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.

Re: Question about JSE example

Posted by Gerhard Petracek <ge...@gmail.com>.
hi charles,

see [1] and [2].

regards,
gerhard

[1] http://s.apache.org/p5
[2] http://s.apache.org/FKB



2012/6/13 Charles Moulliard <cm...@gmail.com>

> Hi,
>
> The example
> org.apache.deltaspike.example.beanmanagement.SimpleBeanLookupExample allows
> to get a CDI container. It starts by invoking the following method
> CdiContainerLoader.getCdiContainer() which will call --> the ServiceLoader
> (
> ServiceLoader<CdiContainer> cdiContainerLoader =
> ServiceLoader.load(CdiContainer.class);).
>
> As there is no file into the directory META-INF/services and the project is
> simply started with mvn -Pexamples, how the SimpleBeanLookupExample knows
> which implementation (OWB, Weld) to be used.
>
> Regards,
>
> Charles
>
>
> --
> View this message in context:
> http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Question-about-JSE-example-tp4652732.html
> Sent from the Apache DeltaSpike Incubator Discussions mailing list archive
> at Nabble.com.
>

Re: Question about JSE example

Posted by Charles Moulliard <cm...@gmail.com>.
Thx. You confirm what I was suspecting as we are using
java.util.ServiceLoader.

--
View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Question-about-JSE-example-tp4652732p4652739.html
Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.

Re: Question about JSE example

Posted by Mark Struberg <st...@yahoo.de>.
Hi Charles!

You either have deltaspike-cdictrl-owb or deltaspike-cdictrl-weld (or any other one) in your classpath. Those jars contain the proper META-INF/services file. The only thing you need to do is to put ONE of those impls into your classpath.

Of course, there is _no_ auto-selection of containers right now!


LieGrue,
strub



----- Original Message -----
> From: Charles Moulliard <cm...@gmail.com>
> To: deltaspike-dev@incubator.apache.org
> Cc: 
> Sent: Wednesday, June 13, 2012 8:52 AM
> Subject: Question about JSE example
> 
> Hi,
> 
> The example
> org.apache.deltaspike.example.beanmanagement.SimpleBeanLookupExample allows
> to get a CDI container. It starts by invoking the following method
> CdiContainerLoader.getCdiContainer() which will call --> the ServiceLoader (
> ServiceLoader<CdiContainer> cdiContainerLoader =
> ServiceLoader.load(CdiContainer.class);).
> 
> As there is no file into the directory META-INF/services and the project is
> simply started with mvn -Pexamples, how the SimpleBeanLookupExample knows
> which implementation (OWB, Weld) to be used.
> 
> Regards,
> 
> Charles 
> 
> 
> --
> View this message in context: 
> http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Question-about-JSE-example-tp4652732.html
> Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at 
> Nabble.com.
>