use of org.springframework.beans.factory.support.BeanDefinitionRegistry in project spring-integration by spring-projects.
the class WsIntegrationConfigurationInitializer method initialize.
@Override
public void initialize(ConfigurableListableBeanFactory beanFactory) throws BeansException {
if (beanFactory instanceof BeanDefinitionRegistry) {
if (beanFactory.getBeanNamesForType(EndpointAdapter.class, false, false).length > 0) {
BeanDefinitionBuilder requestMappingBuilder = BeanDefinitionBuilder.genericBeanDefinition(MessageEndpointAdapter.class);
requestMappingBuilder.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
((BeanDefinitionRegistry) beanFactory).registerBeanDefinition(MESSAGE_ENDPOINT_ADAPTER_BEAN_NAME, requestMappingBuilder.getBeanDefinition());
}
} else {
logger.warn("'IntegrationRequestMappingHandlerMapping' isn't registered because 'beanFactory'" + " isn't an instance of `BeanDefinitionRegistry`.");
}
}
use of org.springframework.beans.factory.support.BeanDefinitionRegistry in project BroadleafCommerce by BroadleafCommerce.
the class MergePersistenceUnitManager method exceptionIfEntityMarkerNotFound.
/**
* Detects the presence of the {@link EntityMarkerClassTransformer} and throws an exception if this is misconfigured. If there
* are no class transformes within {@link #mergedClassTransformers} then this does nothing
*/
protected void exceptionIfEntityMarkerNotFound() {
if (CollectionUtils.isNotEmpty(mergedClassTransformers)) {
boolean foundEntityMarkerTransformer = IterableUtils.find(mergedClassTransformers, new Predicate<BroadleafClassTransformer>() {
@Override
public boolean evaluate(BroadleafClassTransformer object) {
return EntityMarkerClassTransformer.class.isAssignableFrom(object.getClass());
}
}) != null;
if (!foundEntityMarkerTransformer) {
BeanDefinition transformersBeanDef = ((BeanDefinitionRegistry) applicationContext.getAutowireCapableBeanFactory()).getBeanDefinition("blMergedClassTransformers");
String msg = "The EntityMarkerClassTransformer was not detected as registered in the the list of blMergedClassTransformers. This is" + " usually caused the blMergedClassTransformers being overridden in a different configuration. Without this transformer Broadleaf" + " is unable to validate whether or not class transformation happened as expected. This bean was registered as " + transformersBeanDef + " but it should have been detected as registerd in bl-common-applicationContext.xml. Change the definition in " + transformersBeanDef.getResourceDescription() + " to instead utilize the EarlyStageMergeBeanPostProcessor in XML or an @Merge(targetRef=\"blMergedClassTransformers\" early = true) in a Java configuration class";
throw new IllegalStateException(msg);
}
}
}
use of org.springframework.beans.factory.support.BeanDefinitionRegistry in project mule by mulesoft.
the class MuleArtifactContext method postProcessBeanFactory.
@Override
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
Optional<ComponentModel> configurationOptional = applicationModel.findComponentDefinitionModel(CONFIGURATION_IDENTIFIER);
if (configurationOptional.isPresent()) {
return;
}
BeanDefinitionRegistry beanDefinitionRegistry = (BeanDefinitionRegistry) beanFactory;
beanDefinitionRegistry.registerBeanDefinition(OBJECT_MULE_CONFIGURATION, genericBeanDefinition(MuleConfigurationConfigurator.class).getBeanDefinition());
}
use of org.springframework.beans.factory.support.BeanDefinitionRegistry in project service-proxy by membrane.
the class DefaultConfig method postProcessBeanFactory.
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
BeanDefinitionRegistry beanDefinitionRegistry = (BeanDefinitionRegistry) beanFactory;
defineTransformerFactory(beanDefinitionRegistry);
defineLimitedMemoryExchangeStore(beanDefinitionRegistry);
defineTransport(beanDefinitionRegistry);
defineRouter(beanDefinitionRegistry);
}
use of org.springframework.beans.factory.support.BeanDefinitionRegistry in project spring-data-commons by spring-projects.
the class RepositoryBeanDefinitionParser method parse.
/*
* (non-Javadoc)
* @see org.springframework.beans.factory.xml.BeanDefinitionParser#parse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext)
*/
@Nullable
public BeanDefinition parse(Element element, ParserContext parser) {
XmlReaderContext readerContext = parser.getReaderContext();
try {
ResourceLoader resourceLoader = ConfigurationUtils.getRequiredResourceLoader(readerContext);
Environment environment = readerContext.getEnvironment();
BeanDefinitionRegistry registry = parser.getRegistry();
XmlRepositoryConfigurationSource configSource = new XmlRepositoryConfigurationSource(element, parser, environment);
RepositoryConfigurationDelegate delegate = new RepositoryConfigurationDelegate(configSource, resourceLoader, environment);
RepositoryConfigurationUtils.exposeRegistration(extension, registry, configSource);
for (BeanComponentDefinition definition : delegate.registerRepositoriesIn(registry, extension)) {
readerContext.fireComponentRegistered(definition);
}
} catch (RuntimeException e) {
handleError(e, element, readerContext);
}
return null;
}
Aggregations