Hi Romain!

Using openejb would be an option, but the problem is not openejb, but that you 
get tons of additional APIs he might not need.

I really suggest to use DeltaSpike for this. It provides a portable API 
which works with lots of containers (including openejb btw). 



And here comes how it goes. Please put the following into your pom.xml:

><properties>
>    <deltaspike.version>0.2-incubating</deltaspike.version>
></properties>
>...
><dependencies>
>    <dependency>
>        <groupId>org.apache.deltaspike.cdictrl</groupId>
>        <artifactId>deltaspike-cdictrl-api</artifactId>
>        <version>${deltaspike.version}</version>
>        <scope>compile</scope>
>    </dependency>
>    <dependency>
>        <groupId>org.apache.deltaspike.cdictrl</groupId>
>        <artifactId>deltaspike-cdictrl-owb</artifactId>
>        <version>${deltaspike.version}</version>
>        <scope>runtime</scope>
>    </dependency>
></dependencies>



And then you can use the following Code:

>import org.apache.deltaspike.cdise.api.CdiContainer;
>import org.apache.deltaspike.cdise.api.CdiContainerLoader;
>
>...
>CdiContainer cdiContainer= CdiContainerLoader.getCdiContainer();
>cdiContainer.boot();
>cdiContainer.getContextControl().startContexts();>
>....
>
>cdiContainer.shutdown();



That's all, there is nothing more needed...


LieGrue,
strub



>________________________________
> From: Romain Manni-Bucau <[email protected]>
>To: [email protected] 
>Sent: Friday, June 22, 2012 7:51 PM
>Subject: Re: Booting in Java SE?
> 
>
>Getunstance is replaced by currentinstance, just a semantic change.
>There is no standard api that's why it is in test module but it is comparable 
>to weldse. Deltaspike is the proof. If you want sthg standard there is the 
>EJBContainer and openejb for instance.
>- Romain
>Le 22 juin 2012 19:47, "Harald Wellmann" <[email protected]> a 
>écrit :
>
>Am 22.06.2012 19:28, schrieb Romain Manni-Bucau:
>>
>>Hi, in openwebbeans-test you have the CdiContainer.
>>>
>>>
>>Do you mean org.apache.webbeans.cditest.CdiTestContainer in 
>>org.apache.openwebbeans.test:cditest:1.1.4?
>>
>>The corresponding implementation class CdiTestOpenWebBeansContainer also 
>>calls WebBeansContext.getInstance() in its bootContainer() methods.
>>
>>Besides, isn't this container meant for testing and not for running 
>>applications?
>>
>>I'm looking for something like weld-se.
>>
>>Best regards,
>>Harald
>>
>
>

Reply via email to