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;
}
Aggregations