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.cluster.akka.osgi.impl;
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 final class QuarantinedMonitorActorPropsFactory {
17 private static final Logger LOG = LoggerFactory.getLogger(QuarantinedMonitorActorPropsFactory.class);
19 private QuarantinedMonitorActorPropsFactory() {
23 public static Props createProps(final BundleContext bundleContext) {
24 return QuarantinedMonitorActor.props(() -> {
25 // restart the entire karaf container
26 LOG.warn("Restarting karaf container");
27 System.setProperty("karaf.restart.jvm", "true");
28 System.setProperty("karaf.restart", "true");
29 bundleContext.getBundle(0).stop();