package org.opendaylight.controller.cluster.akka.osgi.impl;
import akka.actor.Props;
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigException;
import org.opendaylight.controller.cluster.common.actor.QuarantinedMonitorActor;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
public final class QuarantinedMonitorActorPropsFactory {
private static final Logger LOG = LoggerFactory.getLogger(QuarantinedMonitorActorPropsFactory.class);
+ private static final String DEFAULT_HANDLING_DISABLED =
+ "akka.disable-default-actor-system-quarantined-event-handling";
+
private QuarantinedMonitorActorPropsFactory() {
}
- public static Props createProps(final BundleContext bundleContext) {
+ public static Props createProps(final BundleContext bundleContext, final Config akkaConfig) {
+ try {
+ if (akkaConfig.getBoolean(DEFAULT_HANDLING_DISABLED)) {
+ LOG.info("{} was set, default handling is disabled", DEFAULT_HANDLING_DISABLED);
+ return QuarantinedMonitorActor.props(() -> { });
+ }
+ } catch (ConfigException configEx) {
+ LOG.info("Akka config doesn't contain property {}. Therefore default handling will be used",
+ DEFAULT_HANDLING_DISABLED);
+ }
return QuarantinedMonitorActor.props(() -> {
// restart the entire karaf container
LOG.warn("Restarting karaf container");
<argument ref="blueprintBundleContext" />
</bean>
- <bean id="actorSystemProps" class="org.opendaylight.controller.cluster.akka.osgi.impl.QuarantinedMonitorActorPropsFactory"
- factory-method="createProps">
- <argument ref="blueprintBundleContext" />
- </bean>
-
<bean id="akkaReader" class="org.opendaylight.controller.cluster.common.actor.FileAkkaConfigurationReader"/>
<bean id="akkaConfig" class="org.opendaylight.controller.cluster.akka.impl.AkkaConfigFactory"
factory-method="createAkkaConfig">
<argument ref="akkaReader" />
</bean>
+ <bean id="actorSystemProps" class="org.opendaylight.controller.cluster.akka.osgi.impl.QuarantinedMonitorActorPropsFactory"
+ factory-method="createProps">
+ <argument ref="blueprintBundleContext" />
+ <argument ref="akkaConfig"/>
+ </bean>
+
<bean id="actorSystemProvider" class="org.opendaylight.controller.cluster.akka.impl.ActorSystemProviderImpl"
destroy-method="close">
<argument ref="bundleClassLoader" />