@Override public void run() { server.shutdownNow(); weld.shutdown(); } }));
protected static void stop() { server.shutdownNow(); weld.shutdown(); }
@Override public void shutdown() { upnpServiceShutdownEvent.fire(new UpnpService.Shutdown()); removeLoggingHandler(); // Disable CDI logging handler before stopping CDI container weld.shutdown(); super.shutdown(); }
public static void main(String[] args) throws Exception { Weld weld = new Weld(); final WeldContainer container = weld.initialize(); RequestContext requestContext= container.instance().select(RequestContext.class, UnboundLiteral.INSTANCE).get(); requestContext.activate(); final MyPojo pojo = container.instance().select(MyPojo.class).get(); Thread t = new Thread() { public void run() { RequestContext requestContext= container.instance().select(RequestContext.class, UnboundLiteral.INSTANCE).get(); requestContext.activate(); System.out.println("1" + pojo.ping()); } }; t.start(); t.join(); System.out.println("2" + pojo.ping()); weld.shutdown(); }
public static void main(String[] args) throws IOException { Weld weld = new Weld(); WeldContainer container = weld.initialize(); Application application = container.instance().select(Application.class).get(); application.run(); weld.shutdown(); }
/** * Shut down Weld immediately. Blocks until Weld is completely shut down. */ public void shutdownNow() { weld.shutdown(); }
/** * Shut down Weld immediately. Blocks until Weld is completely shut down. */ public void shutdownNow() { weld.shutdown(); }
/** * Shut down Weld immediately. Blocks until Weld is completely shut down. */ public void shutdownNow() { weld.shutdown(); }
private void stopWeld() { logger.debug("Stopping Weld for test class " + testClass.getCanonicalName()); if (weld != null) { weld.shutdown(); } } }
private void stopWeld() { logger.debug("Stopping Weld for test class " + testClass.getCanonicalName()); if (weld != null) { weld.shutdown(); } } }
protected void stopWeld() { if (weld != null) { weld.shutdown(); } } }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { super.cleanup(context); if (weld != null) { weld.shutdown(); } }
protected void stopWeld() { if (weld != null) { weld.shutdown(); } }
Weld weld = new Weld(); try { WeldContainer container = weld.initialize(); URI baseUri = UriBuilder.fromUri("http://localhost/").port(8080).build(); ResourceConfig config = ResourceConfig.forApplicationClass(MyApplication.class); Server server = JettyHttpContainerFactory.createServer(baseUri, config); server.join(); } catch (Exception e) { e.printStackTrace(); } finally { weld.shutdown(); }
@Override public Completable shutdown() { return Completable.defer(() -> { weld.shutdown(); return super.shutdown(); }); }
Weld weld = new Weld(); WeldContainer container = weld.initialize(); World helloWorld = container.instance().select(World.class).get(); System.out.println(helloWorld.helloWorld()); weld.shutdown();
@Override public String execute(CliContext context) { cleanup(context.getParameter("tmp-dir")); context.getWeld().shutdown(); System.exit(0); return null; }
@After public void cleanup() { if (weld != null) { weld.shutdown(); } }
// Initialize Weld Weld theWeld = new Weld(); WeldContainer theContainer = theWeld.initialize(); // Execute the run method theContainer.instance().select(Main.class).get().run(); // Shutting down Weld again theWeld.shutdown();
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(); } }