/** * Stops the <code>MuleContext</code> which stops all sessions and connectors * * @throws MuleException if either any of the sessions or connectors fail to stop */ @Override public void stop() throws MuleException { synchronized (lifecycleStateLock) { startLatch.release(); stopIfNeeded(extensionManager); getLifecycleManager().checkPhase(Stoppable.PHASE_NAME); fireNotification(new MuleContextNotification(this, CONTEXT_STOPPING)); getLifecycleManager().fireLifecycle(Stoppable.PHASE_NAME); fireNotification(new MuleContextNotification(this, CONTEXT_STOPPED)); listeners.forEach(l -> l.onStop(this, getApiRegistry())); } }