Skip to content

Commit 35bc9b6

Browse files
concrete > expand setup
1 parent 91fbba0 commit 35bc9b6

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

hivemq-edge/src/main/java/com/hivemq/HiveMQEdgeBootstrap.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ private void bootstrapCoreComponents() {
162162
try {
163163
commercialModuleLoaderDiscovery = new CommercialModuleLoaderDiscovery(moduleLoader);
164164
commercialModuleLoaderDiscovery.discoverModuleLoaderMainClasses();
165-
generalBootstrapService = new GeneralBootstrapServiceImpl(shutdownHooks, metricRegistry, systemInformation);
165+
generalBootstrapService =
166+
new GeneralBootstrapServiceImpl(shutdownHooks, metricRegistry, systemInformation, configService);
166167
commercialModuleLoaderDiscovery.generalBootstrap(generalBootstrapService);
167168
} catch (Exception e) {
168169
log.warn("Error on loading the commercial module loader.", e);
@@ -178,7 +179,6 @@ private void bootstrapPersistences() {
178179

179180
try {
180181
persistenceBootstrapService = PersistenceBootstrapServiceImpl.decorate(generalBootstrapService,
181-
configService,
182182
persistencesService,
183183
capabilityService);
184184
commercialModuleLoaderDiscovery.persistenceBootstrap(persistenceBootstrapService);

hivemq-edge/src/main/java/com/hivemq/bootstrap/services/GeneralBootstrapService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.codahale.metrics.MetricRegistry;
44
import com.hivemq.common.shutdown.ShutdownHooks;
55
import com.hivemq.configuration.info.SystemInformation;
6+
import com.hivemq.configuration.service.ConfigurationService;
67
import com.hivemq.extension.sdk.api.annotations.NotNull;
78

89
public interface GeneralBootstrapService {
@@ -14,4 +15,5 @@ public interface GeneralBootstrapService {
1415

1516
@NotNull ShutdownHooks shutdownHooks();
1617

18+
@NotNull ConfigurationService configurationService();
1719
}

hivemq-edge/src/main/java/com/hivemq/bootstrap/services/GeneralBootstrapServiceImpl.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.codahale.metrics.MetricRegistry;
44
import com.hivemq.common.shutdown.ShutdownHooks;
55
import com.hivemq.configuration.info.SystemInformation;
6+
import com.hivemq.configuration.service.ConfigurationService;
67
import com.hivemq.extension.sdk.api.annotations.NotNull;
78

89
/**
@@ -14,14 +15,17 @@ public class GeneralBootstrapServiceImpl implements GeneralBootstrapService {
1415
private final @NotNull ShutdownHooks shutdownHooks;
1516
private final @NotNull MetricRegistry metricRegistry;
1617
private final @NotNull SystemInformation systemInformation;
18+
private final @NotNull ConfigurationService configurationService;
1719

1820
public GeneralBootstrapServiceImpl(
1921
final @NotNull ShutdownHooks shutdownHooks,
2022
final @NotNull MetricRegistry metricRegistry,
21-
final @NotNull SystemInformation systemInformation) {
23+
final @NotNull SystemInformation systemInformation,
24+
final @NotNull ConfigurationService configurationService) {
2225
this.shutdownHooks = shutdownHooks;
2326
this.metricRegistry = metricRegistry;
2427
this.systemInformation = systemInformation;
28+
this.configurationService = configurationService;
2529
}
2630

2731
@Override
@@ -39,5 +43,10 @@ public GeneralBootstrapServiceImpl(
3943
return shutdownHooks;
4044
}
4145

46+
@Override
47+
public @NotNull ConfigurationService configurationService() {
48+
return configurationService;
49+
}
50+
4251

4352
}

hivemq-edge/src/main/java/com/hivemq/bootstrap/services/PersistenceBootstrapService.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ public interface PersistenceBootstrapService extends GeneralBootstrapService {
1616

1717
static PersistenceBootstrapService decorate(
1818
final @NotNull GeneralBootstrapService generalBootstrapService,
19-
final @NotNull ConfigurationService configurationService,
2019
final @NotNull PersistencesService persistencesService,
2120
final @NotNull HiveMQCapabilityService capabilityService) {
2221
return PersistenceBootstrapServiceImpl.decorate(generalBootstrapService,
23-
configurationService,
2422
persistencesService,
2523
capabilityService);
2624
}

hivemq-edge/src/main/java/com/hivemq/bootstrap/services/PersistenceBootstrapServiceImpl.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@
1111
public class PersistenceBootstrapServiceImpl implements PersistenceBootstrapService {
1212

1313
private final @NotNull GeneralBootstrapService delegate;
14-
private final @NotNull ConfigurationService configurationService;
1514
private final @NotNull PersistencesService persistencesService;
1615
private final @NotNull HiveMQCapabilityService capabilityService;
1716

1817
private PersistenceBootstrapServiceImpl(
1918
final @NotNull GeneralBootstrapService delegate,
20-
final @NotNull ConfigurationService configurationService,
2119
final @NotNull PersistencesService persistencesService,
2220
final @NotNull HiveMQCapabilityService capabilityService) {
2321
this.delegate = delegate;
24-
this.configurationService = configurationService;
2522
this.persistencesService = persistencesService;
2623
this.capabilityService = capabilityService;
2724
}
@@ -44,7 +41,7 @@ private PersistenceBootstrapServiceImpl(
4441

4542
@Override
4643
public @NotNull ConfigurationService configurationService() {
47-
return configurationService;
44+
return delegate.configurationService();
4845
}
4946

5047
@Override
@@ -59,11 +56,9 @@ private PersistenceBootstrapServiceImpl(
5956

6057
public static @NotNull PersistenceBootstrapService decorate(
6158
final @NotNull GeneralBootstrapService generalBootstrapService,
62-
final @NotNull ConfigurationService configurationService,
6359
final @NotNull PersistencesService persistencesService,
6460
final @NotNull HiveMQCapabilityService capabilityService) {
6561
return new PersistenceBootstrapServiceImpl(generalBootstrapService,
66-
configurationService,
6762
persistencesService,
6863
capabilityService);
6964
}

0 commit comments

Comments
 (0)