Remove CSS modules
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / akka / osgi / impl / QuarantinedMonitorActorPropsFactory.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.cluster.akka.osgi.impl;
9
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;
15
16 public final class QuarantinedMonitorActorPropsFactory {
17     private static final Logger LOG = LoggerFactory.getLogger(QuarantinedMonitorActorPropsFactory.class);
18
19     private QuarantinedMonitorActorPropsFactory() {
20
21     }
22
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             bundleContext.getBundle(0).stop();
29         });
30     }
31 }