Search in sources :

Example 1 with ComponentDefinitionRegistryProcessor

use of org.apache.aries.blueprint.ComponentDefinitionRegistryProcessor in project aries by apache.

the class BlueprintContainerImpl method processProcessors.

private void processProcessors() throws Exception {
    // Instantiate ComponentDefinitionRegistryProcessor and BeanProcessor
    for (BeanMetadata bean : getMetadata(BeanMetadata.class)) {
        if (bean instanceof ExtendedBeanMetadata && !((ExtendedBeanMetadata) bean).isProcessor()) {
            continue;
        }
        Class clazz = null;
        if (bean instanceof ExtendedBeanMetadata) {
            clazz = ((ExtendedBeanMetadata) bean).getRuntimeClass();
        }
        if (clazz == null && bean.getClassName() != null) {
            clazz = loadClass(bean.getClassName());
        }
        if (clazz == null) {
            continue;
        }
        if (ComponentDefinitionRegistryProcessor.class.isAssignableFrom(clazz)) {
            Object obj = repository.create(bean.getId(), Arrays.<Class<?>>asList(ComponentDefinitionRegistryProcessor.class));
            ((ComponentDefinitionRegistryProcessor) obj).process(componentDefinitionRegistry);
        } else if (Processor.class.isAssignableFrom(clazz)) {
            Object obj = repository.create(bean.getId(), Arrays.<Class<?>>asList(Processor.class));
            this.processors.add((Processor) obj);
        } else {
            continue;
        }
        updateUninstantiatedRecipes();
    }
}
Also used : ExtendedBeanMetadata(org.apache.aries.blueprint.ExtendedBeanMetadata) Processor(org.apache.aries.blueprint.Processor) ComponentDefinitionRegistryProcessor(org.apache.aries.blueprint.ComponentDefinitionRegistryProcessor) ExtendedBeanMetadata(org.apache.aries.blueprint.ExtendedBeanMetadata) BeanMetadata(org.osgi.service.blueprint.reflect.BeanMetadata) ComponentDefinitionRegistryProcessor(org.apache.aries.blueprint.ComponentDefinitionRegistryProcessor)

Aggregations

ComponentDefinitionRegistryProcessor (org.apache.aries.blueprint.ComponentDefinitionRegistryProcessor)1 ExtendedBeanMetadata (org.apache.aries.blueprint.ExtendedBeanMetadata)1 Processor (org.apache.aries.blueprint.Processor)1 BeanMetadata (org.osgi.service.blueprint.reflect.BeanMetadata)1