use of org.apache.aries.blueprint.mutable.MutableBeanMetadata in project controller by opendaylight.
the class OpendaylightNamespaceHandler method parseRpcImplementation.
private static Metadata parseRpcImplementation(final Element element, final ParserContext context) {
registerRpcRegistryServiceRefBean(context);
MutableBeanMetadata metadata = createBeanMetadata(context, context.generateId(), RpcImplementationBean.class, true, true);
addBlueprintBundleRefProperty(context, metadata);
metadata.addProperty("rpcRegistry", createRef(context, RPC_REGISTRY_NAME));
metadata.addProperty("implementation", createRef(context, element.getAttribute(REF_ATTR)));
if (element.hasAttribute(INTERFACE)) {
metadata.addProperty("interfaceName", createValue(context, element.getAttribute(INTERFACE)));
}
LOG.debug("parseRpcImplementation returning {}", metadata);
return metadata;
}
use of org.apache.aries.blueprint.mutable.MutableBeanMetadata in project controller by opendaylight.
the class OpendaylightNamespaceHandler method createBeanMetadata.
private static MutableBeanMetadata createBeanMetadata(final ParserContext context, final String id, final Class<?> runtimeClass, final boolean initMethod, final boolean destroyMethod) {
MutableBeanMetadata metadata = context.createMetadata(MutableBeanMetadata.class);
metadata.setId(id);
metadata.setScope(BeanMetadata.SCOPE_SINGLETON);
metadata.setActivation(ReferenceMetadata.ACTIVATION_EAGER);
metadata.setRuntimeClass(runtimeClass);
if (initMethod) {
metadata.setInitMethod("init");
}
if (destroyMethod) {
metadata.setDestroyMethod("destroy");
}
return metadata;
}
use of org.apache.aries.blueprint.mutable.MutableBeanMetadata in project controller by opendaylight.
the class OpendaylightNamespaceHandler method registerRoutedRpcRegistrationConverter.
private static void registerRoutedRpcRegistrationConverter(final ParserContext context) {
ComponentDefinitionRegistry registry = context.getComponentDefinitionRegistry();
if (registry.getComponentDefinition(ROUTED_RPC_REG_CONVERTER_NAME) == null) {
MutableBeanMetadata metadata = createBeanMetadata(context, ROUTED_RPC_REG_CONVERTER_NAME, RoutedRpcRegistrationConverter.class, false, false);
metadata.setActivation(ReferenceMetadata.ACTIVATION_LAZY);
registry.registerTypeConverter(metadata);
}
}
use of org.apache.aries.blueprint.mutable.MutableBeanMetadata in project controller by opendaylight.
the class OpendaylightNamespaceHandler method enableComponentProcessorProperty.
private static ComponentMetadata enableComponentProcessorProperty(final Attr attr, final ComponentMetadata component, final ParserContext context, final String propertyName) {
if (component != null) {
throw new ComponentDefinitionException("Attribute " + attr.getNodeName() + " can only be used on the root <blueprint> element");
}
LOG.debug("{}: {}", propertyName, attr.getValue());
if (!Boolean.parseBoolean(attr.getValue())) {
return component;
}
MutableBeanMetadata metadata = registerComponentProcessor(context);
metadata.addProperty(propertyName, createValue(context, "true"));
return component;
}
use of org.apache.aries.blueprint.mutable.MutableBeanMetadata in project service-proxy by membrane.
the class BlueprintElementParser method handleChildElement.
protected void handleChildElement(Element ele, ParserContext context, MutableBeanMetadata mcm, BlueprintParser globalParser) {
Metadata m = globalParser.parse(globalParser, ele, context);
Class<?> clazz = null;
if (m instanceof MutableBeanMetadata) {
clazz = ((MutableBeanMetadata) m).getRuntimeClass();
} else {
throw new RuntimeException("Don't know how to get bean class from " + m.getClass() + ": " + ele.getNodeName());
}
handleChildObject(ele, context, mcm, clazz, m);
}
Aggregations