Skip to content

Commit

Permalink
Remove unnecessary rawConfig parameter of DittoService#getMainRootAct…
Browse files Browse the repository at this point in the history
…orProps

Signed-off-by: Yannic Klem <yannic.klem@bosch.io>
  • Loading branch information
Yannic92 committed Jul 20, 2022
1 parent 528899c commit e392b46
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 40 deletions.
Expand Up @@ -376,8 +376,7 @@ private void startDevOpsCommandsActor(final ActorSystem actorSystem) {
* is overridden, the following methods will not be called automatically:</em>
* </p>
* <ul>
* <li>{@link #getMainRootActorProps(org.eclipse.ditto.base.service.config.ServiceSpecificConfig,
* com.typesafe.config.Config, akka.actor.ActorRef, akka.actor.ActorSystem)},</li>
* <li>{@link #getMainRootActorProps(org.eclipse.ditto.base.service.config.ServiceSpecificConfig, akka.actor.ActorRef)},</li>
* <li>{@link #startMainRootActor(akka.actor.ActorSystem, akka.actor.Props)},</li>
* </ul>
*
Expand All @@ -394,7 +393,7 @@ private void startServiceRootActors(final ActorSystem actorSystem, final C servi

injectSystemPropertiesLimits(serviceSpecificConfig);

startMainRootActor(actorSystem, getMainRootActorProps(serviceSpecificConfig, rawConfig, pubSubMediator));
startMainRootActor(actorSystem, getMainRootActorProps(serviceSpecificConfig, pubSubMediator));
RootActorStarter.get(actorSystem, ScopedConfig.dittoExtension(actorSystem.settings().config())).execute();
});
}
Expand Down Expand Up @@ -431,9 +430,7 @@ private static ActorRef getDistributedPubSubMediatorActor(final ActorSystem acto
* @param pubSubMediator ActorRef of the distributed pub-sub-mediator.
* @return the Props.
*/
protected abstract Props getMainRootActorProps(C serviceSpecificConfig,
final Config rawConfig,
final ActorRef pubSubMediator);
protected abstract Props getMainRootActorProps(C serviceSpecificConfig, final ActorRef pubSubMediator);

/**
* Starts the main root actor of this service. May be overridden to change the way of starting this service's root
Expand Down
Expand Up @@ -63,8 +63,7 @@ protected ConnectivityConfig getServiceSpecificConfig(final ScopedConfig dittoCo
}

@Override
protected Props getMainRootActorProps(final ConnectivityConfig connectivityConfig, final Config rawConfig,
final ActorRef pubSubMediator) {
protected Props getMainRootActorProps(final ConnectivityConfig connectivityConfig, final ActorRef pubSubMediator) {
return ConnectivityRootActor.props(connectivityConfig, pubSubMediator);
}

Expand Down
Expand Up @@ -272,8 +272,8 @@ public static Props props(final ConnectionId connectionId,
final ActorRef pubSubMediator,
final Config connectivityConfigOverwrites
) {
return Props.create(ConnectionPersistenceActor.class, () -> new ConnectionPersistenceActor(connectionId,
commandForwarderActor, pubSubMediator, Trilean.UNKNOWN, connectivityConfigOverwrites));
return Props.create(ConnectionPersistenceActor.class, connectionId,
commandForwarderActor, pubSubMediator, Trilean.UNKNOWN, connectivityConfigOverwrites);
}

/**
Expand Down
Expand Up @@ -20,8 +20,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.typesafe.config.Config;

import akka.actor.ActorRef;
import akka.actor.Props;

Expand Down Expand Up @@ -58,8 +56,7 @@ protected GatewayConfig getServiceSpecificConfig(final ScopedConfig dittoConfig)
}

@Override
protected Props getMainRootActorProps(final GatewayConfig gatewayConfig, final Config rawConfig,
final ActorRef pubSubMediator) {
protected Props getMainRootActorProps(final GatewayConfig gatewayConfig, final ActorRef pubSubMediator) {

return GatewayRootActor.props(gatewayConfig, pubSubMediator);
}
Expand Down
Expand Up @@ -112,16 +112,14 @@ public static Props props(final PolicyId policyId,
final ActorRef announcementManager,
final PolicyConfig policyConfig) {

return Props.create(PolicyPersistenceActor.class, () -> new PolicyPersistenceActor(policyId, pubSubMediator,
announcementManager, policyConfig));
return Props.create(PolicyPersistenceActor.class, policyId, pubSubMediator, announcementManager, policyConfig);
}

static Props propsForTests(final PolicyId policyId,
final ActorRef pubSubMediator,
final ActorRef announcementManager) {

return Props.create(PolicyPersistenceActor.class, () -> new PolicyPersistenceActor(policyId, pubSubMediator,
announcementManager));
return Props.create(PolicyPersistenceActor.class, policyId, pubSubMediator, announcementManager);
}

@Override
Expand Down
Expand Up @@ -86,8 +86,8 @@ private PoliciesRootActor(final PoliciesConfig policiesConfig, final ActorRef pu
ClusterUtil.startSingleton(actorSystem, getContext(), PoliciesMessagingConstants.CLUSTER_ROLE,
BlockedNamespacesUpdater.ACTOR_NAME, blockedNamespacesUpdaterProps);

final var policySupervisorProps = getPolicySupervisorActorProps(pubSubMediator,
policyAnnouncementPub, blockedNamespaces);
final var policySupervisorProps =
getPolicySupervisorActorProps(pubSubMediator, policyAnnouncementPub, blockedNamespaces);

final var clusterConfig = policiesConfig.getClusterConfig();
final ShardRegionExtractor shardRegionExtractor = ShardRegionExtractor.of(clusterConfig.getNumberOfShards(),
Expand Down
Expand Up @@ -14,8 +14,6 @@

import org.eclipse.ditto.base.service.DittoService;
import org.eclipse.ditto.internal.utils.config.ScopedConfig;
import org.eclipse.ditto.internal.utils.persistence.SnapshotAdapter;
import org.eclipse.ditto.policies.model.Policy;
import org.eclipse.ditto.policies.service.common.config.DittoPoliciesConfig;
import org.eclipse.ditto.policies.service.common.config.PoliciesConfig;
import org.slf4j.Logger;
Expand All @@ -25,7 +23,6 @@
import com.typesafe.config.ConfigValueFactory;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;

/**
Expand Down Expand Up @@ -60,9 +57,7 @@ protected PoliciesConfig getServiceSpecificConfig(final ScopedConfig dittoConfig
}

@Override
protected Props getMainRootActorProps(final PoliciesConfig policiesConfig, final Config rawConfig,
final ActorRef pubSubMediator) {

protected Props getMainRootActorProps(final PoliciesConfig policiesConfig, final ActorRef pubSubMediator) {
return PoliciesRootActor.props(policiesConfig, pubSubMediator);
}

Expand Down
Expand Up @@ -93,10 +93,6 @@ private ThingPersistenceActor(final ThingId thingId,
this.distributedPub = distributedPub;
}

private static Config getThingsRawConfig(final ActorSystem actorSystem) {
return ScopedConfig.getOrEmpty(actorSystem.settings().config(), "ditto.things");
}

/**
* Creates Akka configuration object {@link Props} for this ThingPersistenceActor.
*
Expand All @@ -107,7 +103,7 @@ private static Config getThingsRawConfig(final ActorSystem actorSystem) {
public static Props props(final ThingId thingId,
final DistributedPub<ThingEvent<?>> distributedPub) {

return Props.create(ThingPersistenceActor.class, () -> new ThingPersistenceActor(thingId, distributedPub));
return Props.create(ThingPersistenceActor.class, thingId, distributedPub);
}

@Override
Expand Down
Expand Up @@ -63,9 +63,7 @@ protected ThingsConfig getServiceSpecificConfig(final ScopedConfig dittoConfig)
}

@Override
protected Props getMainRootActorProps(final ThingsConfig thingsConfig, final Config rawConfig,
final ActorRef pubSubMediator) {

protected Props getMainRootActorProps(final ThingsConfig thingsConfig, final ActorRef pubSubMediator) {
return ThingsRootActor.props(thingsConfig, pubSubMediator, ThingPersistenceActor::props);
}

Expand Down
Expand Up @@ -20,10 +20,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.typesafe.config.Config;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;

/**
Expand Down Expand Up @@ -58,9 +55,7 @@ protected SearchConfig getServiceSpecificConfig(final ScopedConfig dittoConfig)
}

@Override
protected Props getMainRootActorProps(final SearchConfig searchConfig,
final Config rawConfig,
final ActorRef pubSubMediator) {
protected Props getMainRootActorProps(final SearchConfig searchConfig, final ActorRef pubSubMediator) {

return SearchRootActor.props(searchConfig, pubSubMediator);
}
Expand Down

0 comments on commit e392b46

Please sign in to comment.