Esempio n. 1
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);
   }
 }