Package org.jboss.weld.environment.se

Examples of org.jboss.weld.environment.se.Weld


  // =          Lifecycle Methods         =
  // ======================================

  @BeforeClass
  public static void init() {
    weld = new Weld();
    container = weld.initialize();
  }
View Full Code Here


  // =          Lifecycle Methods         =
  // ======================================

  @BeforeClass
  public static void init() {
    weld = new Weld();
    container = weld.initialize();
  }
View Full Code Here

  // =          Lifecycle Methods         =
  // ======================================

  @BeforeClass
  public static void init() {
    weld = new Weld();
    container = weld.initialize();
  }
View Full Code Here

  // =          Lifecycle Methods         =
  // ======================================

  @BeforeClass
  public static void init() {
    weld = new Weld();
    container = weld.initialize();
  }
View Full Code Here

  // =          Lifecycle Methods         =
  // ======================================

  @BeforeClass
  public static void init() {
    weld = new Weld();
    container = weld.initialize();
  }
View Full Code Here

  // =          Lifecycle Methods         =
  // ======================================

  @BeforeClass
  public static void init() {
    weld = new Weld();
    container = weld.initialize();
  }
View Full Code Here

*/
public class Main {

  public static void main(String[] args) {

    Weld weld = new Weld();
    WeldContainer container = weld.initialize();

    BookService bookService = container.instance().select(BookService.class).get();

    Book book = bookService.createBook("H2G2", 12.5f, "Geeky scifi Book");

    System.out.println(book);

    weld.shutdown();
  }
View Full Code Here

            cls = Thread.currentThread().getContextClassLoader().loadClass( "org.drools.compiler.cdi.test.KProjectTestClassjar2" );
            assertNotNull( cls );
            cls = Thread.currentThread().getContextClassLoader().loadClass( "org.drools.compiler.cdi.test.KProjectTestClassjar3" );
            assertNotNull( cls );
           
            Weld weld = CDITestRunner.createWeld(KProjectTestClass.class.getName(),
                                                 KPTestLiteral.class.getName(),
                                                 "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 );           
            testEntry(o1, "jar1");
           
            beans = container.getBeanManager().getBeans( KProjectTestClass.class, new KPTestLiteral( "jar2" ) );
            bean = (Bean) beans.toArray()[0];
            KProjectTestClass o2 = (KProjectTestClass) bean.create( container.getBeanManager().createCreationalContext( null ) );
            assertNotNull( o2 );           
            testEntry(o2, "jar2");
           
            beans = container.getBeanManager().getBeans( KProjectTestClass.class, new KPTestLiteral( "jar3" ) );
            bean = (Bean) beans.toArray()[0];
            KProjectTestClass o3 = (KProjectTestClass) bean.create( container.getBeanManager().createCreationalContext( null ) );
            assertNotNull( o3 );           
            testEntry(o3, "jar3");

            beans = container.getBeanManager().getBeans( KProjectTestClass.class, new KPTestLiteral( "fol4" ) );
            bean = (Bean) beans.toArray()[0];
            KProjectTestClass o4 = (KProjectTestClass) bean.create( container.getBeanManager().createCreationalContext( null ) );
            assertNotNull( o4 );           
            testEntry(o4, "fol4");
           
            weld.shutdown();
        } finally {
            Thread.currentThread().setContextClassLoader( origCl );
        }
    }
View Full Code Here

    }
  }

  @Override
  public void run(RunNotifier notifier) {
    Weld weld = new Weld();
    weld.initialize();

    this.startup();
    super.run(notifier);

    weld.shutdown();
  }
View Full Code Here

    private Weld weld;

    @Override
    public void initialize() throws Exception {
        logger.log(Level.INFO, "Initializing JBoss WELD...");
        this.weld = new Weld();
        this.weld.initialize();
    }
View Full Code Here

TOP

Related Classes of org.jboss.weld.environment.se.Weld

Copyright © 2018 www.massapicom. 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.