Search in sources :

Example 1 with BlueprintContainerRestartService

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;
}
Also used : MutableBeanMetadata(org.apache.aries.blueprint.mutable.MutableBeanMetadata) ComponentDefinitionRegistry(org.apache.aries.blueprint.ComponentDefinitionRegistry) BlueprintContainerRestartService(org.opendaylight.controller.blueprint.BlueprintContainerRestartService)

Example 2 with BlueprintContainerRestartService

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());
        }
    }
}
Also used : BlueprintContainerRestartService(org.opendaylight.controller.blueprint.BlueprintContainerRestartService)

Aggregations

BlueprintContainerRestartService (org.opendaylight.controller.blueprint.BlueprintContainerRestartService)2 ComponentDefinitionRegistry (org.apache.aries.blueprint.ComponentDefinitionRegistry)1 MutableBeanMetadata (org.apache.aries.blueprint.mutable.MutableBeanMetadata)1