Search in sources :

Example 1 with RegistryDelegatingInjector

use of org.mule.runtime.core.internal.registry.RegistryDelegatingInjector in project mule by mulesoft.

the class DefaultMuleContextBuilder method buildMuleContext.

/**
 * {@inheritDoc}
 */
@Override
public MuleContext buildMuleContext() {
    logger.debug("Building new DefaultMuleContext instance with MuleContextBuilder: " + this);
    DefaultMuleContext muleContext = createDefaultMuleContext();
    muleContext.setMuleConfiguration(injectMuleContextIfRequired(getMuleConfiguration(), muleContext));
    muleContext.setNotificationManager(injectMuleContextIfRequired(getNotificationManager(), muleContext));
    muleContext.setLifecycleManager(injectMuleContextIfRequired(getLifecycleManager(), muleContext));
    muleContext.setArtifactType(artifactType);
    DefaultRegistryBroker registryBroker = new DefaultRegistryBroker(muleContext, muleContext.getLifecycleInterceptor());
    muleContext.setRegistryBroker(registryBroker);
    MuleRegistryHelper muleRegistry = new MuleRegistryHelper(registryBroker, muleContext);
    muleContext.setMuleRegistry(muleRegistry);
    muleContext.setInjector(new RegistryDelegatingInjector(muleRegistry));
    muleContext.setExceptionListener(createExceptionListener(muleContext));
    muleContext.setExecutionClassLoader(getExecutionClassLoader());
    muleContext.setBootstrapServiceDiscoverer(injectMuleContextIfRequired(createBootstrapDiscoverer(), muleContext));
    muleContext.setDeploymentProperties(getDeploymentProperties());
    muleContext.setListeners(listeners);
    getObjectSerializer(muleContext);
    if (errorTypeRepository == null) {
        errorTypeRepository = createDefaultErrorTypeRepository();
    }
    muleContext.setErrorTypeRepository(errorTypeRepository);
    muleContext.setErrorTypeLocator(createDefaultErrorTypeLocator(errorTypeRepository));
    return muleContext;
}
Also used : MuleRegistryHelper(org.mule.runtime.core.internal.registry.MuleRegistryHelper) DefaultRegistryBroker(org.mule.runtime.core.internal.registry.DefaultRegistryBroker) RegistryDelegatingInjector(org.mule.runtime.core.internal.registry.RegistryDelegatingInjector)

Aggregations

DefaultRegistryBroker (org.mule.runtime.core.internal.registry.DefaultRegistryBroker)1 MuleRegistryHelper (org.mule.runtime.core.internal.registry.MuleRegistryHelper)1 RegistryDelegatingInjector (org.mule.runtime.core.internal.registry.RegistryDelegatingInjector)1