Search in sources :

Example 1 with SplashScreen

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;
}
Also used : ArtifactStartupSplashScreen(org.mule.runtime.core.internal.util.splash.ArtifactStartupSplashScreen) ServerStartupSplashScreen(org.mule.runtime.core.internal.util.splash.ServerStartupSplashScreen) SplashScreen(org.mule.runtime.core.internal.util.splash.SplashScreen) ServerStartupSplashScreen(org.mule.runtime.core.internal.util.splash.ServerStartupSplashScreen) ArtifactShutdownSplashScreen(org.mule.runtime.core.internal.util.splash.ArtifactShutdownSplashScreen) ServerShutdownSplashScreen(org.mule.runtime.core.internal.util.splash.ServerShutdownSplashScreen) ArtifactStartupSplashScreen(org.mule.runtime.core.internal.util.splash.ArtifactStartupSplashScreen)

Example 2 with SplashScreen

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;
}
Also used : ArtifactShutdownSplashScreen(org.mule.runtime.core.internal.util.splash.ArtifactShutdownSplashScreen) SplashScreen(org.mule.runtime.core.internal.util.splash.SplashScreen) ServerStartupSplashScreen(org.mule.runtime.core.internal.util.splash.ServerStartupSplashScreen) ArtifactShutdownSplashScreen(org.mule.runtime.core.internal.util.splash.ArtifactShutdownSplashScreen) ServerShutdownSplashScreen(org.mule.runtime.core.internal.util.splash.ServerShutdownSplashScreen) ArtifactStartupSplashScreen(org.mule.runtime.core.internal.util.splash.ArtifactStartupSplashScreen) ServerShutdownSplashScreen(org.mule.runtime.core.internal.util.splash.ServerShutdownSplashScreen)

Example 3 with SplashScreen

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());
        }
    }
}
Also used : MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException) SplashScreen(org.mule.runtime.core.internal.util.splash.SplashScreen) ServerStartupSplashScreen(org.mule.runtime.core.internal.util.splash.ServerStartupSplashScreen) ArtifactShutdownSplashScreen(org.mule.runtime.core.internal.util.splash.ArtifactShutdownSplashScreen) ServerShutdownSplashScreen(org.mule.runtime.core.internal.util.splash.ServerShutdownSplashScreen) ArtifactStartupSplashScreen(org.mule.runtime.core.internal.util.splash.ArtifactStartupSplashScreen) MuleContextNotification(org.mule.runtime.core.api.context.notification.MuleContextNotification)

Example 4 with SplashScreen

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);
    }
}
Also used : SplashScreen(org.mule.runtime.core.internal.util.splash.SplashScreen) ServerStartupSplashScreen(org.mule.runtime.core.internal.util.splash.ServerStartupSplashScreen) ArtifactShutdownSplashScreen(org.mule.runtime.core.internal.util.splash.ArtifactShutdownSplashScreen) ServerShutdownSplashScreen(org.mule.runtime.core.internal.util.splash.ServerShutdownSplashScreen) ArtifactStartupSplashScreen(org.mule.runtime.core.internal.util.splash.ArtifactStartupSplashScreen) MuleContextNotification(org.mule.runtime.core.api.context.notification.MuleContextNotification) MuleException(org.mule.runtime.api.exception.MuleException) InitialisationException(org.mule.runtime.api.lifecycle.InitialisationException) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException) MuleException(org.mule.runtime.api.exception.MuleException) ConnectException(org.mule.runtime.core.api.connector.ConnectException) LifecycleException(org.mule.runtime.api.lifecycle.LifecycleException) RegistrationException(org.mule.runtime.core.privileged.registry.RegistrationException)

Aggregations

ArtifactShutdownSplashScreen (org.mule.runtime.core.internal.util.splash.ArtifactShutdownSplashScreen)4 ArtifactStartupSplashScreen (org.mule.runtime.core.internal.util.splash.ArtifactStartupSplashScreen)4 ServerShutdownSplashScreen (org.mule.runtime.core.internal.util.splash.ServerShutdownSplashScreen)4 ServerStartupSplashScreen (org.mule.runtime.core.internal.util.splash.ServerStartupSplashScreen)4 SplashScreen (org.mule.runtime.core.internal.util.splash.SplashScreen)4 MuleRuntimeException (org.mule.runtime.api.exception.MuleRuntimeException)2 MuleContextNotification (org.mule.runtime.core.api.context.notification.MuleContextNotification)2 MuleException (org.mule.runtime.api.exception.MuleException)1 InitialisationException (org.mule.runtime.api.lifecycle.InitialisationException)1 LifecycleException (org.mule.runtime.api.lifecycle.LifecycleException)1 ConnectException (org.mule.runtime.core.api.connector.ConnectException)1 RegistrationException (org.mule.runtime.core.privileged.registry.RegistrationException)1