v.setClassName(value);
return v;
}
protected MutableBeanMetadata getBus(ParserContext context, String name) {
ComponentDefinitionRegistry cdr = context.getComponentDefinitionRegistry();
ComponentMetadata meta = cdr.getComponentDefinition("blueprintBundle");
Bundle blueprintBundle = null;
if (meta instanceof PassThroughMetadata) {
blueprintBundle = (Bundle) ((PassThroughMetadata) meta).getObject();
}
if (!cdr.containsComponentDefinition(InterceptorTypeConverter.class.getName())) {
MutablePassThroughMetadata md = context.createMetadata(MutablePassThroughMetadata.class);
md.setObject(new InterceptorTypeConverter());
md.setId(InterceptorTypeConverter.class.getName());
context.getComponentDefinitionRegistry().registerTypeConverter(md);
}
if (blueprintBundle != null && !cdr.containsComponentDefinition(name)) {
//Create a bus
MutableBeanMetadata bus = context.createMetadata(MutableBeanMetadata.class);
bus.setId(name);
bus.setRuntimeClass(BlueprintBus.class);
bus.addProperty("bundleContext", createRef(context, "blueprintBundleContext"));
bus.addProperty("blueprintContainer", createRef(context, "blueprintContainer"));
bus.setDestroyMethod("shutdown");
bus.setInitMethod("initialize");
context.getComponentDefinitionRegistry().registerComponentDefinition(bus);
return bus;
}
return (MutableBeanMetadata) cdr.getComponentDefinition(name);
}