[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openejb-user
Subject:    Re: bootstrap openwebbeans into java se application
From:       Romain Manni-Bucau <rmannibucau () gmail ! com>
Date:       2013-09-18 8:20:23
Message-ID: CACLE=7OC4G7RXzhXheXfmwGS1GBULWiZ=oHBET4s7h+d9C5KpA () mail ! gmail ! com
[Download RAW message or body]

Hi


Maybe you want to have a look to Apache DeltaSpike CdiContainer:
http://deltaspike.apache.org/documentation.html#start-a-cdi-container-using-java-se

For OpenEJB a common pattern is:


public static void main(String[] a) {
    Main main = new Main();

    container = EJBContainer.createEJBContainer(/* props if needed */);
    container.getContext().bind("inject", main);

   main.doMain(a); // real main

}

Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2013/9/18 mauro2java2011 <mauro2java2011@gmail.com>:
> but with a Class :
> 
> import javax.swing.*;
> 
> public class MyPersonalApplication {
> JForm form;
> JPanel panel;
> JButton button;
> 
> // i have to inject like below a instance of it?????
> @Siingleton
> @Startup
> private MyPersonalApplication myPersonalApplication;
> 
> //constructor
> public MyPersonalApplication (){
> form =new JForm();
> panel= new JPanel();
> button=new JButton();
> //other code for initialize components swing and add the listener......
> panel.add(button();
> 
> form.getContentPane.add(panel);
> form.pack();
> 
> 
> JPanel panel;
> JButton button;
> }
> 
> }
> 
> 
> hi hjave to inject a instance of the sanme class?
> i have to wirte also a method man(String[]arg){
> 
> //
> }
> or  not ???
> 
> 2) what jars i have to put int othe classpath of SE applicatio nswing for
> get OpenwebBeans to work???
> 
> 
> 
> 
> --
> View this message in context: \
> http://openejb.979440.n4.nabble.com/bootstrap-openwebbeans-into-java-se-application-tp4665109p4665122.html
>  Sent from the OpenEJB User mailing list archive at Nabble.com.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic