当前位置: 首页>>代码示例>>Java>>正文


Java Weld.shutdown方法代码示例

本文整理汇总了Java中org.jboss.weld.environment.se.Weld.shutdown方法的典型用法代码示例。如果您正苦于以下问题:Java Weld.shutdown方法的具体用法?Java Weld.shutdown怎么用?Java Weld.shutdown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.weld.environment.se.Weld的用法示例。


在下文中一共展示了Weld.shutdown方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import org.jboss.weld.environment.se.Weld; //导入方法依赖的package包/类
public void run(GeneratorTrigger context) throws IOException {
	Weld weld = new Weld();
	try {
		weld.setClassLoader(context.getClassLoader());
		weld.initialize();

		CrnkBoot boot = new CrnkBoot();
		boot.setServiceUrlProvider(new ConstantServiceUrlProvider("http://<generator>"));
		boot.boot();

		ModuleRegistry moduleRegistry = boot.getModuleRegistry();
		Optional<MetaModule> optionalModule = moduleRegistry.getModule(MetaModule.class);

		if (!optionalModule.isPresent()) {
			throw new IllegalStateException(
					"add MetaModule to CDI setup, got: " + moduleRegistry.getModules() + " with " + boot
							.getServiceDiscovery());
		}

		MetaModule metaModule = optionalModule.get();
		MetaLookup lookup = metaModule.getLookup();
		context.generate(lookup);
	}
	finally {
		weld.shutdown();
	}

}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:29,代码来源:CdiRunner.java

示例2: main

import org.jboss.weld.environment.se.Weld; //导入方法依赖的package包/类
public static void main(String[] args) {
    //Boostrap the CDI container, in this case WELD
    Weld w = new Weld();

    WeldContainer wc = w.initialize();
    App app = wc.instance().select(App.class).get();
    app.bootstrapDrools();

    w.shutdown();
}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:11,代码来源:App.java

示例3: main

import org.jboss.weld.environment.se.Weld; //导入方法依赖的package包/类
public static void main(String args[])
{
    Weld weld = new Weld(); 
    WeldContainer container = weld.initialize(); 

    ShopCar sc = container.instance().select(ShopCar.class).get(); 
    sc.execute();
    weld.shutdown();
}
 
开发者ID:vfreitas-,项目名称:ShopCar,代码行数:10,代码来源:ShopCar.java

示例4: testInjection

import org.jboss.weld.environment.se.Weld; //导入方法依赖的package包/类
@Test
public void testInjection(){
    Weld weld = new Weld();
    WeldContainer container = weld.initialize();
    ConfiguredClass item = container.instance().select(ConfiguredClass.class).get();
    System.out.println("********************************************");
    System.out.println(item);
    System.out.println("********************************************");
    weld.shutdown();
}
 
开发者ID:java-config,项目名称:tamaya-export,代码行数:11,代码来源:ConfiguredTest.java

示例5: main

import org.jboss.weld.environment.se.Weld; //导入方法依赖的package包/类
public static void main( String[] args ) {
	Weld weld = new Weld();
	WeldContainer container = weld.initialize();
	try {
 	Firmware firmware = container.instance().select(Firmware.class).get();
 	firmware.run();
	
	} catch (Exception e) {
		e.printStackTrace();
		
	} finally {
		weld.shutdown();
	}
	
}
 
开发者ID:pablodanielrey,项目名称:firmware,代码行数:16,代码来源:App.java

示例6: main

import org.jboss.weld.environment.se.Weld; //导入方法依赖的package包/类
public static void main(String[] args) {
    final Weld weld = new Weld();
    final WeldContainer container = weld.initialize();
    final HelloWorld helloBean = container.instance()
            .select(HelloWorld.class).get();
    helloBean.greet(args);

    weld.shutdown();
}
 
开发者ID:peterpilgrim,项目名称:javaee7-developer-handbook,代码行数:10,代码来源:HelloWorld.java

示例7: main

import org.jboss.weld.environment.se.Weld; //导入方法依赖的package包/类
public static void main(String[] args) {

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

        EmailSender emailSender = container.instance().select(EmailSender.class).get();

        emailSender.sendMail("Hello, bub", "Looking for some quality $product?");

        weld.shutdown();
    }
 
开发者ID:rombert,项目名称:email-sender,代码行数:12,代码来源:WeldApplication.java


注:本文中的org.jboss.weld.environment.se.Weld.shutdown方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。