Package org.jboss.weld.environment.se

Examples of org.jboss.weld.environment.se.Weld.initialize()


            {
               weld.addExtension(e);
            }
         }
         this.helper = helper;
         this.container = weld.initialize();
         // This is an ugly hack to make sure that the BeanManagerProxy is initialized with the right Container
         // This is needed especially when we intend to initialize several weld containers within the same instance
         container.getBeanManager().getBeans(org.jboss.weld.environment.se.WeldContainer.class);
         this.weldContainer = org.jboss.weld.Container.instance();
         this.weld = weld;
View Full Code Here


public class CDITest {
    @Test
    public void testInitWeld() {
        Weld weld = new Weld();
        WeldContainer weldContainer = weld.initialize();
        BeanManager bm = CdiInjectorFactory.lookupBeanManagerCDIUtil();
        Assert.assertNotNull(bm);
        weld.shutdown();
    }
}
View Full Code Here

               // FIXME this plugin loading scheme causes classloading issues w/weld because weld cannot load classes
               // from its own classloaders before plugins are loaded and pollute the classpath.
               // We can work around it by loading weld before we load plugins, then restarting weld, but this is SLOW.
               try {
                  WeldContainer container = weld.initialize();
                  manager = container.getBeanManager();
                  weld.shutdown();
               }
               catch (Exception e) {}
View Full Code Here

               catch (Exception e) {}

               try {
                  // TODO verify plugin API versions. only activate compatible plugins.
                  loadPlugins();
                  WeldContainer container = weld.initialize();
                  manager = container.getBeanManager();
               }
               catch (Throwable e) {
                  // Boot up with external plugins disabled.
                  System.out
View Full Code Here

                  e.printStackTrace();

                  Thread.currentThread().setContextClassLoader(mainClassLoader);

                  initLogging();
                  WeldContainer container = weld.initialize();
                  manager = container.getBeanManager();
               }

               manager.fireEvent(new PreStartup());
               manager.fireEvent(new Startup(workingDir, restarting));
View Full Code Here

             * Experimental stand-alone Weld-support
             */
            if (bm == null) {
                try {
                    Weld weld = new Weld();
                    ctx.bind(BEAN_MANAGER_JNDI, weld.initialize().getBeanManager());
                    return lookupBeanManager();
                } catch (NamingException e2) {
                    bm = null;
                }

View Full Code Here

     * Or run it and fill in -i and -o correctly.
     * @param args never null
     */
    public static void main(String... args) {
        Weld weld = new Weld();
        WeldContainer weldContainer = weld.initialize();

        Jcr2VfsMigrater migrater = weldContainer.instance().select(Jcr2VfsMigrater.class).get();
        if(migrater.parseArgs(args)) {
            migrater.migrateAll();
        }
View Full Code Here

public class CDIExampleWithInclusionTest {

    @Test
    public void testGo() {
        Weld w = new Weld();
        WeldContainer wc = w.initialize();

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        PrintStream ps = new PrintStream(baos);

        CDIExampleWithInclusion bean = wc.instance().select(CDIExampleWithInclusion.class).get();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.