@Override public void stop() { try { if (containerInstance.isRunning()) { containerInstance.close(); } } catch (NullPointerException npe) { System.err.println(STOP_EXCEPTION_MESSAGE); npe.printStackTrace(System.err); } }
/** * * @return <code>true</code> if the container was initialized completely and is not shut down yet, <code>false</code> otherwise */ public boolean isRunning() { return container.isRunning(); }
/** * * @return <code>true</code> if the container was initialized completely and is not shut down yet, <code>false</code> otherwise */ public boolean isRunning() { return container.isRunning(); }
private void checkContainer() { if (weldContainer == null || !weldContainer.isRunning()) { throw new IllegalStateException("Weld container is not initialized or already shut down"); } }
private void checkContainer() { if (container == null || !container.isRunning()) { throw new IllegalStateException("Weld container is not running"); } }
private void checkContainer() { if (weldContainer == null || !weldContainer.isRunning()) { throw new IllegalStateException("Weld container is not initialized or already shut down"); } }
private void checkContainer() { if (container == null || !container.isRunning()) { throw new IllegalStateException("Weld container is not running"); } }
public void close() { if (container != null && container.isRunning()) { try { container.close(); } catch (Throwable ignore) { } } }
@Override public void stop(Future<Void> stopFuture) throws Exception { if (weldContainer != null && weldContainer.isRunning()) { // Shutdown can take some time to complete vertx.executeBlocking(future -> { try { weldContainer.shutdown(); future.complete(); } catch (Exception e) { future.fail(e); } }, result -> { if (result.succeeded()) { stopFuture.complete(); } else { stopFuture.fail(result.cause()); } }); } else { stopFuture.complete(); } }
@Override public void stop(Future<Void> stopFuture) throws Exception { if (weldContainer != null && weldContainer.isRunning()) { // Shutdown can take some time to complete vertx.executeBlocking(future -> { try { weldContainer.shutdown(); future.complete(); } catch (Exception e) { future.fail(e); } }, result -> { if (result.succeeded()) { stopFuture.complete(); } else { stopFuture.fail(result.cause()); } }); } else { stopFuture.complete(); } }
protected void shutdownWeldContainer() { try { if (extension != null) { extension.deactivateContexts(); } releaseInstances(); } finally { if (container != null && container.isRunning()) { container.shutdown(); } } } }
protected void shutdownWeldContainer() { try { if (extension != null) { extension.deactivateContexts(); } releaseInstances(); } finally { if (container != null && container.isRunning()) { container.shutdown(); } } } }
executor.execute(); } finally { if (weldContainer != null && weldContainer.isRunning()) { weldContainer.shutdown();