Search in sources :

Example 91 with MutableBeanMetadata

use of org.apache.aries.blueprint.mutable.MutableBeanMetadata in project cxf by apache.

the class AbstractBPBeanDefinitionParser method createObjectOfClass.

public static MutableBeanMetadata createObjectOfClass(ParserContext context, String value) {
    MutableBeanMetadata v = context.createMetadata(MutableBeanMetadata.class);
    v.setClassName(value);
    return v;
}
Also used : MutableBeanMetadata(org.apache.aries.blueprint.mutable.MutableBeanMetadata)

Example 92 with MutableBeanMetadata

use of org.apache.aries.blueprint.mutable.MutableBeanMetadata in project cxf by apache.

the class AbstractBPBeanDefinitionParser method createValue.

public Metadata createValue(ParserContext context, QName qName) {
    MutableBeanMetadata v = context.createMetadata(MutableBeanMetadata.class);
    v.setRuntimeClass(QName.class);
    v.addArgument(createValue(context, qName.getNamespaceURI()), null, 0);
    v.addArgument(createValue(context, qName.getLocalPart()), null, 1);
    return v;
}
Also used : MutableBeanMetadata(org.apache.aries.blueprint.mutable.MutableBeanMetadata)

Example 93 with MutableBeanMetadata

use of org.apache.aries.blueprint.mutable.MutableBeanMetadata in project cxf by apache.

the class SimpleBPBeanDefinitionParser method parse.

public Metadata parse(Element element, ParserContext context) {
    MutableBeanMetadata cxfBean = context.createMetadata(MutableBeanMetadata.class);
    cxfBean.setRuntimeClass(cls);
    String fact = getFactorySuffix();
    if (fact == null) {
        cxfBean.setId(getId(element, context));
    } else {
        cxfBean.setId(getId(element, context) + fact);
    }
    parseAttributes(element, context, cxfBean);
    parseChildElements(element, context, cxfBean);
    if (hasBusProperty()) {
        boolean foundBus = false;
        for (BeanProperty bp : cxfBean.getProperties()) {
            if ("bus".equals(bp.getName())) {
                foundBus = true;
            }
        }
        if (!foundBus) {
            cxfBean.addProperty("bus", getBusRef(context, "cxf"));
        }
    }
    if (fact != null) {
        context.getComponentDefinitionRegistry().registerComponentDefinition(cxfBean);
        MutableBeanMetadata bean = context.createMetadata(MutableBeanMetadata.class);
        bean.setId(getId(element, context));
        bean.setFactoryComponent(cxfBean);
        bean.setFactoryMethod("create");
        bean.setClassName(getFactoryCreateType(element));
        return bean;
    }
    return cxfBean;
}
Also used : MutableBeanMetadata(org.apache.aries.blueprint.mutable.MutableBeanMetadata) BeanProperty(org.osgi.service.blueprint.reflect.BeanProperty)

Example 94 with MutableBeanMetadata

use of org.apache.aries.blueprint.mutable.MutableBeanMetadata in project cxf by apache.

the class PolicyBPDefinitionParser method parse.

public Metadata parse(Element element, ParserContext context) {
    MutablePassThroughMetadata factory = context.createMetadata(MutablePassThroughMetadata.class);
    factory.setId(resolveId(element, context) + UUID.randomUUID().toString());
    PolicyBean policyBean = new PolicyBean();
    policyBean.setElement(element);
    factory.setObject(new PassThroughCallable<Object>(policyBean));
    MutableBeanMetadata resourceBean = context.createMetadata(MutableBeanMetadata.class);
    resourceBean.setId(resolveId(element, context));
    resourceBean.setFactoryComponent(factory);
    resourceBean.setFactoryMethod("call");
    return resourceBean;
}
Also used : MutablePassThroughMetadata(org.apache.aries.blueprint.mutable.MutablePassThroughMetadata) MutableBeanMetadata(org.apache.aries.blueprint.mutable.MutableBeanMetadata) PolicyBean(org.apache.cxf.ws.policy.PolicyBean)

Example 95 with MutableBeanMetadata

use of org.apache.aries.blueprint.mutable.MutableBeanMetadata in project cxf by apache.

the class PolicyEngineBPDefinitionParser method parse.

public Metadata parse(Element element, ParserContext context) {
    MutableBeanMetadata policyEngineConfig = context.createMetadata(MutableBeanMetadata.class);
    policyEngineConfig.setRuntimeClass(PolicyEngineConfig.class);
    String bus = element.getAttribute("bus");
    if (StringUtils.isEmpty(bus)) {
        bus = "cxf";
    }
    policyEngineConfig.addArgument(getBusRef(context, bus), Bus.class.getName(), 0);
    parseAttributes(element, context, policyEngineConfig);
    parseChildElements(element, context, policyEngineConfig);
    policyEngineConfig.setId(PolicyEngineConfig.class.getName() + context.generateId());
    return policyEngineConfig;
}
Also used : MutableBeanMetadata(org.apache.aries.blueprint.mutable.MutableBeanMetadata) Bus(org.apache.cxf.Bus)

Aggregations

MutableBeanMetadata (org.apache.aries.blueprint.mutable.MutableBeanMetadata)96 Element (org.w3c.dom.Element)23 Node (org.w3c.dom.Node)20 MutablePassThroughMetadata (org.apache.aries.blueprint.mutable.MutablePassThroughMetadata)19 Metadata (org.osgi.service.blueprint.reflect.Metadata)19 MutableRefMetadata (org.apache.aries.blueprint.mutable.MutableRefMetadata)18 ComponentDefinitionException (org.osgi.service.blueprint.container.ComponentDefinitionException)18 MutableCollectionMetadata (org.apache.aries.blueprint.mutable.MutableCollectionMetadata)17 BeanMetadata (org.osgi.service.blueprint.reflect.BeanMetadata)16 ComponentMetadata (org.osgi.service.blueprint.reflect.ComponentMetadata)15 MutableValueMetadata (org.apache.aries.blueprint.mutable.MutableValueMetadata)13 RefMetadata (org.osgi.service.blueprint.reflect.RefMetadata)12 NodeList (org.w3c.dom.NodeList)11 MutableMapMetadata (org.apache.aries.blueprint.mutable.MutableMapMetadata)10 PassThroughMetadata (org.apache.aries.blueprint.PassThroughMetadata)9 JAXBException (javax.xml.bind.JAXBException)8 CollectionMetadata (org.osgi.service.blueprint.reflect.CollectionMetadata)8 ValueMetadata (org.osgi.service.blueprint.reflect.ValueMetadata)8 ExpressionNode (org.apache.camel.model.ExpressionNode)7 Attr (org.w3c.dom.Attr)7