use of org.apache.aries.blueprint.mutable.MutableBeanMetadata in project aries by apache.
the class AuthorizationNsHandler method authBeanProcessor.
private MutableBeanMetadata authBeanProcessor(ParserContext pc, ComponentDefinitionRegistry cdr) {
MutableBeanMetadata meta = pc.createMetadata(MutableBeanMetadata.class);
meta.setId(AuthorizationBeanProcessor.AUTH_PROCESSOR_BEAN_NAME);
meta.setRuntimeClass(AuthorizationBeanProcessor.class);
meta.setProcessor(true);
meta.addProperty("cdr", passThrough(pc, cdr));
return meta;
}
use of org.apache.aries.blueprint.mutable.MutableBeanMetadata in project aries by apache.
the class NSHandlerSix method parse.
// process elements
public Metadata parse(Element element, ParserContext context) {
Metadata retval = null;
if (element.getLocalName().equals(ELT_NAME)) {
final String id = element.getAttributeNS(NSURI, ATTRIB_ID);
MutableBeanMetadata bm = context.createMetadata(MutableBeanMetadata.class);
bm.setId(id);
bm.setScope("PROTOTYPE");
bm.setClassName(TestBean.class.getName());
retval = bm;
}
return retval;
}
use of org.apache.aries.blueprint.mutable.MutableBeanMetadata in project aries by apache.
the class NSHandlerThree method decorate.
public ComponentMetadata decorate(Node node, ComponentMetadata component, ParserContext context) {
if (node.getLocalName().equals(ATTRIB_ONE)) {
if (component instanceof BeanMetadata) {
if (context.getComponentDefinitionRegistry().getComponentDefinition(NSURI + "/BeanProcessor") == null) {
BeanMetadata bm = context.createMetadata(BeanMetadata.class);
MutableBeanMetadata mbm = (MutableBeanMetadata) bm;
mbm.setProcessor(true);
mbm.setRuntimeClass(BeanProcessorTest.class);
mbm.setScope(BeanMetadata.SCOPE_SINGLETON);
mbm.setId(NSURI + "/BeanProcessor");
context.getComponentDefinitionRegistry().registerComponentDefinition(mbm);
}
}
}
return component;
}
use of org.apache.aries.blueprint.mutable.MutableBeanMetadata in project aries by apache.
the class IncorrectNamespaceHandler method parse.
@Override
public Metadata parse(Element element, ParserContext context) {
MutableBeanMetadata metadata = context.createMetadata(MutableBeanMetadata.class);
metadata.setProcessor(true);
metadata.setId("aries-1503");
metadata.setScope(BeanMetadata.SCOPE_SINGLETON);
metadata.addArgument(new PassThroughMetadata() {
@Override
public Object getObject() {
return "ARIES-1503";
}
@Override
public String getId() {
return "aries-1503-arg";
}
@Override
public int getActivation() {
return 0;
}
@Override
public List<String> getDependsOn() {
return null;
}
}, null, 0);
metadata.setRuntimeClass(String.class);
return metadata;
}
use of org.apache.aries.blueprint.mutable.MutableBeanMetadata in project aries by apache.
the class NSHandlerOne method decorate.
// process attributes
public ComponentMetadata decorate(Node node, ComponentMetadata component, ParserContext context) {
// and RefMetadata.
if (component != null && component instanceof MutableBeanMetadata) {
MutableBeanMetadata mbm = (MutableBeanMetadata) component;
Attr a = (Attr) node;
Element bean = a.getOwnerElement();
String propname = bean.getAttributeNS(NSURI, ATTRIB_ONE);
// if this were not a test, we might attempt to ensure this ref existed
String passthruref = bean.getAttributeNS(NSURI, ATTRIB_TWO);
MutableRefMetadata ref = (MutableRefMetadata) context.createMetadata(RefMetadata.class);
ref.setComponentId(passthruref);
mbm.addProperty(propname, ref);
}
return component;
}
Aggregations