cxfBean.addProperty(name, createValue(context, q)); } else if ("depends-on".equals(name)) { cxfBean.addDependsOn(val); } else if ("implementor".equals(name)) { if (val.startsWith("#")) {
protected boolean parseAttributes(Element element, ParserContext ctx, MutableBeanMetadata bean) { NamedNodeMap atts = element.getAttributes(); boolean setBus = false; for (int i = 0; i < atts.getLength(); i++) { Attr node = (Attr) atts.item(i); String val = node.getValue(); String pre = node.getPrefix(); String name = node.getLocalName(); String prefix = node.getPrefix(); // Don't process namespaces if (isNamespace(name, prefix)) { continue; } if ("createdFromAPI".equals(name) || "abstract".equals(name)) { bean.setScope(BeanMetadata.SCOPE_PROTOTYPE); } else { if ("depends-on".equals(name)) { bean.addDependsOn(val); } else if ("name".equals(name)) { processNameAttribute(element, ctx, bean, val); } else if ("bus".equals(name)) { processBusAttribute(element, ctx, bean, val); } else if (!"id".equals(name) && isAttribute(pre, name)) { mapAttribute(bean, element, name, val, ctx); } } } return setBus; } protected void processBusAttribute(Element element, ParserContext ctx,
protected boolean parseAttributes(Element element, ParserContext ctx, MutableBeanMetadata bean) { NamedNodeMap atts = element.getAttributes(); boolean setBus = false; for (int i = 0; i < atts.getLength(); i++) { Attr node = (Attr) atts.item(i); String val = node.getValue(); String pre = node.getPrefix(); String name = node.getLocalName(); String prefix = node.getPrefix(); // Don't process namespaces if (isNamespace(name, prefix)) { continue; } if ("createdFromAPI".equals(name) || "abstract".equals(name)) { bean.setScope(BeanMetadata.SCOPE_PROTOTYPE); } else { if ("depends-on".equals(name)) { bean.addDependsOn(val); } else if ("name".equals(name)) { processNameAttribute(element, ctx, bean, val); } else if ("bus".equals(name)) { processBusAttribute(element, ctx, bean, val); } else if (!"id".equals(name) && isAttribute(pre, name)) { mapAttribute(bean, element, name, val, ctx); } } } return setBus; } protected void processBusAttribute(Element element, ParserContext ctx,
protected boolean parseAttributes(Element element, ParserContext ctx, MutableBeanMetadata bean) { NamedNodeMap atts = element.getAttributes(); boolean setBus = false; for (int i = 0; i < atts.getLength(); i++) { Attr node = (Attr) atts.item(i); String val = node.getValue(); String pre = node.getPrefix(); String name = node.getLocalName(); String prefix = node.getPrefix(); // Don't process namespaces if (isNamespace(name, prefix)) { continue; } if ("createdFromAPI".equals(name) || "abstract".equals(name)) { bean.setScope(BeanMetadata.SCOPE_PROTOTYPE); } else { if ("depends-on".equals(name)) { bean.addDependsOn(val); } else if ("name".equals(name)) { processNameAttribute(element, ctx, bean, val); } else if ("bus".equals(name)) { processBusAttribute(element, ctx, bean, val); } else if (!"id".equals(name) && isAttribute(pre, name)) { mapAttribute(bean, element, name, val, ctx); } } } return setBus; } protected void processBusAttribute(Element element, ParserContext ctx,
protected boolean parseAttributes(Element element, ParserContext ctx, MutableBeanMetadata bean) { NamedNodeMap atts = element.getAttributes(); boolean setBus = false; for (int i = 0; i < atts.getLength(); i++) { Attr node = (Attr) atts.item(i); String val = node.getValue(); String pre = node.getPrefix(); String name = node.getLocalName(); String prefix = node.getPrefix(); // Don't process namespaces if (isNamespace(name, prefix)) { continue; } if ("createdFromAPI".equals(name) || "abstract".equals(name)) { bean.setScope(BeanMetadata.SCOPE_PROTOTYPE); } else { if ("depends-on".equals(name)) { bean.addDependsOn(val); } else if ("name".equals(name)) { processNameAttribute(element, ctx, bean, val); } else if ("bus".equals(name)) { processBusAttribute(element, ctx, bean, val); } else if (!"id".equals(name) && isAttribute(pre, name)) { mapAttribute(bean, element, name, val, ctx); } } } return setBus; } protected void processBusAttribute(Element element, ParserContext ctx,
} else if (isAttribute(pre, name)) { if ("depends-on".equals(name)) { beanMetadata.addDependsOn(val); } else if (!"name".equals(name)) { beanMetadata.addProperty(name, AbstractBPBeanDefinitionParser.createValue(context, val));
} else if (isAttribute(pre, name)) { if ("depends-on".equals(name)) { beanMetadata.addDependsOn(val); } else if (!"name".equals(name)) { beanMetadata.addProperty(name, AbstractBPBeanDefinitionParser.createValue(context, val));
endpointConfig.addDependsOn(val); } else if (!"name".equals(name)) { endpointConfig.addProperty(name, createValue(context, val));
cxfBean.addProperty(name, createValue(context, q)); } else if ("depends-on".equals(name)) { cxfBean.addDependsOn(val); } else if ("implementor".equals(name)) { if (val.startsWith("#")) {
protected void applySpringInterfacePatches(ParserContext context, Class<?> clazz, MutableBeanMetadata mcm) { if (ApplicationContextAware.class.isAssignableFrom(clazz)) { MutableRefMetadata mirm = context.createMetadata(MutableRefMetadata.class); mirm.setComponentId("blueprintContainer"); MutableBeanMetadata helper = context.createMetadata(MutableBeanMetadata.class); helper.setId(context.generateId()); helper.setScope(BeanMetadata.SCOPE_SINGLETON); helper.setRuntimeClass(BlueprintSpringInterfaceHelper.class); helper.addProperty("blueprintContainer", mirm); context.getComponentDefinitionRegistry().registerComponentDefinition(helper); // this does not work: // mcm.addProperty("applicationContext", simulatedSpringApplicationContext); // -- the "applicationContext" property could possibly be set before any of the other properties (as they // are filled in using a HashMap), which differs from the Spring logic. // workaround: helper.addProperty("client", mcm); helper.setInitMethod("init"); helper.setDestroyMethod("destroy"); mcm.addDependsOn(helper.getId()); return; // Lifecycle is handled by the Helper as well } if (Lifecycle.class.isAssignableFrom(clazz)) { mcm.setInitMethod("start"); mcm.setDestroyMethod("stop"); } }
protected void registerBean(ParserContext context, String contextId, AbstractCamelFactoryBean<?> fact) { String id = fact.getId(); fact.setCamelContextId(contextId); MutablePassThroughMetadata eff = context.createMetadata(MutablePassThroughMetadata.class); eff.setId(".camelBlueprint.bean.passthrough." + id); eff.setObject(new PassThroughCallable<Object>(fact)); MutableBeanMetadata ef = context.createMetadata(MutableBeanMetadata.class); ef.setId(".camelBlueprint.bean.factory." + id); ef.setFactoryComponent(eff); ef.setFactoryMethod("call"); ef.addProperty("blueprintContainer", createRef(context, "blueprintContainer")); ef.setInitMethod("afterPropertiesSet"); ef.setDestroyMethod("destroy"); MutableBeanMetadata e = context.createMetadata(MutableBeanMetadata.class); e.setId(id); e.setRuntimeClass(fact.getObjectType()); e.setFactoryComponent(ef); e.setFactoryMethod("getObject"); e.addDependsOn(".camelBlueprint.processor.bean." + contextId); context.getComponentDefinitionRegistry().registerComponentDefinition(e); }
factory2.addProperty("blueprintContainer", createRef(context, "blueprintContainer")); factory2.addProperty("bundleContext", createRef(context, "blueprintBundleContext")); factory2.addDependsOn(propertiesComponentResolver.getId()); regProcessor.setFactoryMethod("call"); regProcessor.setProcessor(true); regProcessor.addDependsOn(".camelBlueprint.processor.bean." + contextId); regProcessor.addProperty("blueprintContainer", createRef(context, "blueprintContainer")); context.getComponentDefinitionRegistry().registerComponentDefinition(regProcessor);