Search in sources :

Example 1 with InstallException

use of org.mule.runtime.deployment.model.api.InstallException in project mule by mulesoft.

the class DefaultMuleApplication method install.

@Override
public void install() {
    withContextClassLoader(null, () -> {
        if (logger.isInfoEnabled()) {
            logger.info(miniSplash(format("New app '%s'", descriptor.getName())));
        }
    });
    // set even though it might be redundant, just in case the app is been redeployed
    updateStatusFor(NotInLifecyclePhase.PHASE_NAME);
    try {
        for (String configFile : this.descriptor.getConfigResources()) {
            URL configFileUrl = getArtifactClassLoader().getClassLoader().getResource(configFile);
            if (configFileUrl == null) {
                String message = format("Config for app '%s' not found: %s", getArtifactName(), configFile);
                throw new InstallException(createStaticMessage(message));
            }
        }
    } catch (Exception e) {
        setStatusToFailed();
        throw e;
    }
}
Also used : InstallException(org.mule.runtime.deployment.model.api.InstallException) URL(java.net.URL) InstallException(org.mule.runtime.deployment.model.api.InstallException) DeploymentStartException(org.mule.runtime.deployment.model.api.DeploymentStartException) DeploymentStopException(org.mule.runtime.deployment.model.api.DeploymentStopException) MuleException(org.mule.runtime.api.exception.MuleException) DeploymentInitException(org.mule.runtime.deployment.model.api.DeploymentInitException)

Aggregations

URL (java.net.URL)1 MuleException (org.mule.runtime.api.exception.MuleException)1 DeploymentInitException (org.mule.runtime.deployment.model.api.DeploymentInitException)1 DeploymentStartException (org.mule.runtime.deployment.model.api.DeploymentStartException)1 DeploymentStopException (org.mule.runtime.deployment.model.api.DeploymentStopException)1 InstallException (org.mule.runtime.deployment.model.api.InstallException)1