import akka.actor.ActorSystem;
import akka.actor.Props;
-import akka.japi.Effect;
import akka.osgi.BundleDelegatingClassLoader;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
actorSystem.actorOf(Props.create(TerminationMonitor.class), TerminationMonitor.ADDRESS);
- actorSystem.actorOf(QuarantinedMonitorActor.props(new Effect() {
-
- @Override
- public void apply() throws Exception {
- // restart the entire karaf container
- LOG.warn("Restarting karaf container");
- System.setProperty("karaf.restart", "true");
- bundleContext.getBundle(0).stop();
- }
+ actorSystem.actorOf(QuarantinedMonitorActor.props(() -> {
+ // restart the entire karaf container
+ LOG.warn("Restarting karaf container");
+ System.setProperty("karaf.restart", "true");
+ bundleContext.getBundle(0).stop();
}), QuarantinedMonitorActor.ADDRESS);
}
}
@Override
+ @SuppressWarnings("checkstyle:IllegalCatch")
public void close() {
LOG.info("Shutting down ActorSystem");