當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。