Search in sources :

Example 1 with ArtifactDeploymentListener

use of org.mule.runtime.module.deployment.api.ArtifactDeploymentListener in project mule by mulesoft.

the class DefaultMuleCoreExtensionManagerServer method initializeCoreExtensions.

private void initializeCoreExtensions() throws MuleException {
    LOGGER.info("Initializing core extensions");
    Injector simpleRegistry = createContainerInjector();
    for (MuleCoreExtension extension : orderedCoreExtensions) {
        if (extension instanceof DeploymentServiceAware) {
            ((DeploymentServiceAware) extension).setDeploymentService(deploymentService);
        }
        if (extension instanceof RepositoryServiceAware) {
            ((RepositoryServiceAware) extension).setRepositoryService(repositoryService);
        }
        if (extension instanceof ToolingServiceAware) {
            ((ToolingServiceAware) extension).setToolingService(toolingService);
        }
        if (extension instanceof ArtifactDeploymentListener) {
            deploymentService.addDeploymentListener(createDeploymentListenerAdapter((ArtifactDeploymentListener) extension, APP));
            deploymentService.addDomainDeploymentListener(createDeploymentListenerAdapter((ArtifactDeploymentListener) extension, DOMAIN));
        }
        if (extension instanceof DeploymentListener) {
            deploymentService.addDeploymentListener((DeploymentListener) extension);
        }
        if (extension instanceof CoreExtensionsAware) {
            ((CoreExtensionsAware) extension).setCoreExtensions(orderedCoreExtensions);
        }
        if (extension instanceof ArtifactClassLoaderManagerAware) {
            ((ArtifactClassLoaderManagerAware) extension).setArtifactClassLoaderManager(artifactClassLoaderManager);
        }
        simpleRegistry.inject(extension);
        extension.initialise();
        initializedCoreExtensions.add(extension);
        LOGGER.info("Core extension '{}' initialized", extension.toString());
    }
}
Also used : DeploymentServiceAware(org.mule.runtime.module.deployment.api.DeploymentServiceAware) ArtifactDeploymentListener(org.mule.runtime.module.deployment.api.ArtifactDeploymentListener) ArtifactClassLoaderManagerAware(org.mule.runtime.container.api.ArtifactClassLoaderManagerAware) Injector(org.mule.runtime.core.api.Injector) RepositoryServiceAware(org.mule.runtime.module.repository.api.RepositoryServiceAware) MuleCoreExtension(org.mule.runtime.container.api.MuleCoreExtension) ToolingServiceAware(org.mule.runtime.module.tooling.api.ToolingServiceAware) DeploymentListener(org.mule.runtime.module.deployment.api.DeploymentListener) ArtifactDeploymentListener(org.mule.runtime.module.deployment.api.ArtifactDeploymentListener) CoreExtensionsAware(org.mule.runtime.container.api.CoreExtensionsAware)

Aggregations

ArtifactClassLoaderManagerAware (org.mule.runtime.container.api.ArtifactClassLoaderManagerAware)1 CoreExtensionsAware (org.mule.runtime.container.api.CoreExtensionsAware)1 MuleCoreExtension (org.mule.runtime.container.api.MuleCoreExtension)1 Injector (org.mule.runtime.core.api.Injector)1 ArtifactDeploymentListener (org.mule.runtime.module.deployment.api.ArtifactDeploymentListener)1 DeploymentListener (org.mule.runtime.module.deployment.api.DeploymentListener)1 DeploymentServiceAware (org.mule.runtime.module.deployment.api.DeploymentServiceAware)1 RepositoryServiceAware (org.mule.runtime.module.repository.api.RepositoryServiceAware)1 ToolingServiceAware (org.mule.runtime.module.tooling.api.ToolingServiceAware)1