本文整理汇总了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();
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
示例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();
}
示例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();
}