本文整理匯總了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();
}