Package org.jboss.weld.environment.se

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


    // Create new Weld Container
    Weld weld = new Weld();
   
    // All the components initialization and wiring is done here
    WeldContainer container = weld.initialize();
   
    // Get application instance
    // This instance will be initialized with all required components
    MyApplication app = container.instance().select(MyApplication.class).get();
   
View Full Code Here


               boolean restarting = restartRequested;
               restartRequested = false;

               initLogging();
               Weld weld = new Weld();
               WeldContainer container = weld.initialize();
               BeanManager manager = container.getBeanManager();
               manager.fireEvent(new Startup(workingDir, restarting));
               manager.fireEvent(new AcceptUserInput());
               weld.shutdown();
            }
View Full Code Here

               Weld weld = new ModularWeld();
               BeanManager manager = null;
               try {
                  loadPlugins();
                  initLogging();
                  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

                                                 "org.drools.compiler.cdi.test.KProjectTestClassjar1",
                                                 "org.drools.compiler.cdi.test.KProjectTestClassjar2",
                                                 "org.drools.compiler.cdi.test.KProjectTestClassjar3",
                                                 "org.drools.compiler.cdi.test.KProjectTestClassfol4");
            ((KieServicesImpl) KieServices.Factory.get()).nullKieClasspathContainer();
            WeldContainer container = weld.initialize();           
           
            Set<Bean< ? >> beans = container.getBeanManager().getBeans( KProjectTestClass.class, new KPTestLiteral( "jar1" ) );
            Bean bean = (Bean) beans.toArray()[0];
            KProjectTestClass o1 = (KProjectTestClass) bean.create( container.getBeanManager().createCreationalContext( null ) );
            assertNotNull( o1 );           
View Full Code Here

               loadPlugins();
               initLogging();
               Weld weld = new Weld();
               // WeldBootstrap bootstrap = new WeldBootstrap();
               WeldContainer container = weld.initialize();
               BeanManager manager = container.getBeanManager();
               manager.fireEvent(new PreStartup());
               manager.fireEvent(new Startup(workingDir, restarting));
               manager.fireEvent(new PostStartup());
               manager.fireEvent(new AcceptUserInput());
View Full Code Here

            }
            else
            {
               final Weld weld = new ModularWeld(scanResult);
               WeldContainer container;
               container = weld.initialize();

               final BeanManager manager = container.getBeanManager();
               Assert.notNull(manager, "BeanManager was null");

               AddonRepositoryProducer repositoryProducer = BeanManagerUtils.getContextualInstance(manager,
View Full Code Here

               BeanManager manager = null;
               try {
                  // TODO verify plugin API versions. only activate compatible plugins.
                  loadPlugins();
                  initLogging();
                  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

            {
               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

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.