use of org.mule.runtime.core.internal.util.splash.SplashScreen in project mule by mulesoft.
the class DefaultMuleContext method buildStartupSplash.
private SplashScreen buildStartupSplash() {
SplashScreen startupScreen = config.isContainerMode() ? new ArtifactStartupSplashScreen() : new ServerStartupSplashScreen();
startupScreen.setHeader(this);
startupScreen.setFooter(this);
return startupScreen;
}
use of org.mule.runtime.core.internal.util.splash.SplashScreen in project mule by mulesoft.
the class DefaultMuleContext method buildShutdownSplash.
private SplashScreen buildShutdownSplash() {
SplashScreen shutdownScreen = config.isContainerMode() ? new ArtifactShutdownSplashScreen() : new ServerShutdownSplashScreen();
shutdownScreen.setHeader(this);
return shutdownScreen;
}
use of org.mule.runtime.core.internal.util.splash.SplashScreen in project mule by mulesoft.
the class DefaultMuleContext method start.
@Override
public void start() throws MuleException {
synchronized (lifecycleStateLock) {
getLifecycleManager().checkPhase(Startable.PHASE_NAME);
if (getQueueManager() == null) {
throw new MuleRuntimeException(objectIsNull("queueManager"));
}
componentInitialStateManager = muleRegistryHelper.get(OBJECT_COMPONENT_INITIAL_STATE_MANAGER);
startDate = System.currentTimeMillis();
startIfNeeded(extensionManager);
fireNotification(new MuleContextNotification(this, CONTEXT_STARTING));
getLifecycleManager().fireLifecycle(Startable.PHASE_NAME);
overridePollingController();
overrideClusterConfiguration();
startMessageSources();
fireNotification(new MuleContextNotification(this, CONTEXT_STARTED));
listeners.forEach(l -> l.onStart(this, getApiRegistry()));
startLatch.release();
if (logger.isInfoEnabled()) {
SplashScreen startupScreen = buildStartupSplash();
logger.info(startupScreen.toString());
}
}
}
use of org.mule.runtime.core.internal.util.splash.SplashScreen in project mule by mulesoft.
the class DefaultMuleContext method dispose.
@Override
public void dispose() {
synchronized (lifecycleStateLock) {
if (isStarted() || (lifecycleManager.getLastPhaseExecuted() != null && (lifecycleManager.getLastPhaseExecuted().equals(Startable.PHASE_NAME) && lifecycleManager.isLastPhaseExecutionFailed()))) {
try {
stop();
} catch (MuleException e) {
logger.error("Failed to stop Mule context", e);
}
}
getLifecycleManager().checkPhase(Disposable.PHASE_NAME);
fireNotification(new MuleContextNotification(this, CONTEXT_DISPOSING));
disposeIfNeeded(getExceptionListener(), logger);
try {
getLifecycleManager().fireLifecycle(Disposable.PHASE_NAME);
// abstraction?
if (muleRegistryHelper != null) {
safely(() -> muleRegistryHelper.dispose());
}
} catch (Exception e) {
logger.debug("Failed to cleanly dispose Mule: " + e.getMessage(), e);
}
notificationManager.fireNotification(new MuleContextNotification(this, CONTEXT_DISPOSED));
disposeManagers();
if ((getStartDate() > 0) && logger.isInfoEnabled()) {
SplashScreen shutdownScreen = buildShutdownSplash();
logger.info(shutdownScreen.toString());
}
// registryBroker.dispose();
setExecutionClassLoader(null);
}
}
Aggregations