use of org.opendaylight.controller.blueprint.BlueprintContainerRestartService in project controller by opendaylight.
the class OpendaylightNamespaceHandler method registerComponentProcessor.
private static MutableBeanMetadata registerComponentProcessor(final ParserContext context) {
ComponentDefinitionRegistry registry = context.getComponentDefinitionRegistry();
MutableBeanMetadata metadata = (MutableBeanMetadata) registry.getComponentDefinition(COMPONENT_PROCESSOR_NAME);
if (metadata == null) {
metadata = createBeanMetadata(context, COMPONENT_PROCESSOR_NAME, ComponentProcessor.class, false, true);
metadata.setProcessor(true);
addBlueprintBundleRefProperty(context, metadata);
metadata.addProperty("blueprintContainerRestartService", createServiceRef(context, BlueprintContainerRestartService.class, null));
LOG.debug("Registering ComponentProcessor bean: {}", metadata);
registry.registerComponentDefinition(metadata);
}
return metadata;
}
use of org.opendaylight.controller.blueprint.BlueprintContainerRestartService in project controller by opendaylight.
the class AbstractDependentComponentFactoryMetadata method restartContainer.
protected void restartContainer() {
if (restarting.compareAndSet(false, true)) {
BlueprintContainerRestartService restartService = getOSGiService(BlueprintContainerRestartService.class);
if (restartService != null) {
log.debug("{}: Restarting container", logName());
restartService.restartContainerAndDependents(container().getBundleContext().getBundle());
}
}
}
Aggregations