use of org.mule.runtime.deployment.model.api.DeploymentStopException in project mule by mulesoft.
the class DefaultMuleApplication method stop.
@Override
public void stop() {
if (this.artifactContext == null || !this.artifactContext.getMuleContext().getLifecycleManager().isDirectTransition(Stoppable.PHASE_NAME)) {
return;
}
if (this.artifactContext == null) {
withContextClassLoader(null, () -> {
// app never started, maybe due to a previous error
if (logger.isInfoEnabled()) {
logger.info(format("Stopping app '%s' with no mule context", descriptor.getName()));
}
});
status = ApplicationStatus.STOPPED;
return;
}
artifactContext.getMuleContext().getLifecycleManager().checkPhase(Stoppable.PHASE_NAME);
try {
withContextClassLoader(null, () -> {
if (logger.isInfoEnabled()) {
logger.info(miniSplash(format("Stopping app '%s'", descriptor.getName())));
}
});
this.artifactContext.getMuleContext().stop();
} catch (MuleException e) {
throw new DeploymentStopException(createStaticMessage(format("Error stopping application '%s'", descriptor.getName())), e);
}
}
Aggregations