Exemplo n.º 1
0
 protected void doDispose() {
   queue = null;
   // threadPool.awaitTerminationAfterShutdown();
   if (workManager != null) {
     workManager.dispose();
   }
 }
Exemplo n.º 2
0
 protected void doStop() throws MuleException {
   if (muleContext.getQueueManager().getQueueSession().getQueue(name).size() > 0) {
     try {
       stopping.whenFalse(null);
     } catch (InterruptedException e) {
       // we can ignore this
       // TODO MULE-863: Why?
     }
   }
   workManager.dispose();
 }
Exemplo n.º 3
0
 protected void doStop() throws MuleException {
   if (queue != null && queue.size() > 0) {
     try {
       stopping.whenFalse(null);
     } catch (InterruptedException e) {
       // we can ignore this
       // TODO MULE-863: Why?
     }
   }
   workManager.dispose();
 }
Exemplo n.º 4
0
  public synchronized void dispose() {
    if (isDisposed()) {
      return;
    }

    ServerNotificationManager notificationManager = getNotificationManager();
    lifecycleManager.checkPhase(Disposable.PHASE_NAME);
    fireNotification(new MuleContextNotification(this, MuleContextNotification.CONTEXT_DISPOSING));

    try {
      if (isStarted()) {
        stop();
      }
    } catch (MuleException e) {
      logger.error("Failed to stop manager: " + e.getMessage(), e);
    }

    try {
      lifecycleManager.firePhase(this, Disposable.PHASE_NAME);
      // Dispose internal registries
      registryBroker.dispose();
    } catch (Exception e) {
      logger.debug("Failed to cleanly dispose Mule: " + e.getMessage(), e);
    }

    notificationManager.fireNotification(
        new MuleContextNotification(this, MuleContextNotification.CONTEXT_DISPOSED));

    notificationManager.dispose();
    workManager.dispose();

    if ((getStartDate() > 0) && logger.isInfoEnabled()) {
      SplashScreen splashScreen = SplashScreen.getInstance(ServerShutdownSplashScreen.class);
      splashScreen.setHeader(this);
      logger.info(splashScreen.toString());
    }

    // SplashScreen holds static variables which need to be cleared in case we restart the server.
    SplashScreen.dispose();
  }