public boolean isContainerMode() { return muleConfiguration.isContainerMode(); }
/** * Generate a generic thread name prefix for this context. * @param muleContext context to generate the name prefix for * @return "[appName]." if Mule is running as a container, otherwise empty string */ public static String getPrefix(MuleContext muleContext) { final boolean containerMode = muleContext.getConfiguration().isContainerMode(); final String id = muleContext.getConfiguration().getId(); return containerMode ? String.format("[%s].", id) : StringUtils.EMPTY; } }
protected void registerMuleService() throws NotCompliantMBeanException, MBeanRegistrationException, InstanceAlreadyExistsException, MalformedObjectNameException { ObjectName on = jmxSupport.getObjectName(String.format("%s:%s", jmxSupport.getDomainName(muleContext, !containerMode), MuleServiceMBean.DEFAULT_JMX_NAME)); if (muleContext.getConfiguration().isContainerMode() && mBeanServer.isRegistered(on)) { // while in container mode, a previous stop() action leaves MuleContext MBean behind for remote start() operation return; } MuleService service = new MuleService(muleContext); ClassloaderSwitchingMBeanWrapper serviceMBean = new ClassloaderSwitchingMBeanWrapper(service, MuleServiceMBean.class, muleContext.getExecutionClassLoader()); logger.debug("Registering mule with name: " + on); mBeanServer.registerMBean(serviceMBean, on); }
protected SplashScreen buildShutdownSplash() { SplashScreen shutdownScreen = config.isContainerMode() ? new ApplicationShutdownSplashScreen() : new ServerShutdownSplashScreen(); shutdownScreen.setHeader(this); return shutdownScreen; }
protected MuleWorkManager createWorkManager() { final MuleConfiguration config = getMuleConfiguration(); // still can be embedded, but in container mode, e.g. in a WAR final String threadPrefix = config.isContainerMode() ? String.format("[%s].Mule", config.getId()) : "MuleServer"; ImmutableThreadingProfile threadingProfile = createMuleWorkManager(); return new MuleWorkManager(threadingProfile, threadPrefix, config.getShutdownTimeout()); }
public void onNotification(MuleContextNotification notification) { if (notification.getAction() == MuleContextNotification.CONTEXT_STOPPED) { boolean containerMode = notification.getMuleContext().getConfiguration().isContainerMode(); unregisterMBeansIfNecessary(containerMode); } } }
protected SplashScreen buildStartupSplash() { SplashScreen startupScreen = config.isContainerMode() ? new ApplicationStartupSplashScreen() : new ServerStartupSplashScreen(); startupScreen.setHeader(this); startupScreen.setFooter(this); return startupScreen; }
final boolean containerMode = muleContext.getConfiguration().isContainerMode(); if (containerMode)
this.containerMode = muleContext.getConfiguration().isContainerMode();