2 * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.config.yang.config.actor_system_provider.impl.factory.osgi;
10 import akka.actor.Props;
11 import org.opendaylight.controller.cluster.common.actor.QuarantinedMonitorActor;
12 import org.osgi.framework.BundleContext;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
16 public class QuarantinedMonitorActorPropsFactory {
17 private static final Logger LOG = LoggerFactory.getLogger(QuarantinedMonitorActorPropsFactory.class);
19 public static Props createProps(final BundleContext bundleContext) {
20 return QuarantinedMonitorActor.props(() -> {
21 // restart the entire karaf container
22 LOG.warn("Restarting karaf container");
23 System.setProperty("karaf.restart.jvm", "true");
24 bundleContext.getBundle(0).stop();