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