Esempio n. 1
0
  @Override
  public void contextDestroyed(ServletContextEvent sce) {
    bootstrap.shutdown();

    if (container != null) container.destroy(new ContainerContext(sce, null));

    super.contextDestroyed(sce);
  }
Esempio n. 2
0
 /**
  * Shutdown the container.
  *
  * @see Weld#initialize()
  */
 public synchronized void shutdown() {
   if (isRunning()) {
     try {
       manager.fireEvent(new ContainerShutdown(id), DestroyedLiteral.APPLICATION);
     } finally {
       SINGLETON.clear(id);
       RUNNING_CONTAINER_IDS.remove(id);
       // Destroy all the dependent beans correctly
       creationalContext.release();
       bootstrap.shutdown();
       WeldSELogger.LOG.weldContainerShutdown(id);
     }
   } else {
     if (WeldSELogger.LOG.isTraceEnabled()) {
       WeldSELogger.LOG.tracev(
           "Spurious call to shutdown from: {0}",
           (Object[]) Thread.currentThread().getStackTrace());
     }
     throw WeldSELogger.LOG.weldContainerAlreadyShutDown(id);
   }
 }