From 85aba6b2e834fa0ca3424aa5ade15128b5778aad Mon Sep 17 00:00:00 2001 From: Yana Vasileva Date: Mon, 15 Jul 2024 10:07:12 +0200 Subject: [PATCH] move registry to Impl --- engine/.clirr-jenkins-ignore.xml | 16 ++++++++++++++++ .../bpm/engine/ProcessEngineConfiguration.java | 12 ------------ .../bpm/engine/impl/ManagementServiceImpl.java | 10 +++++----- .../impl/cfg/ProcessEngineConfigurationImpl.java | 9 +++++++++ .../mgmt/telemetry/TelemetryDynamicDataTest.java | 2 +- .../project/qa/simple/SimpleApplicationIT.java | 3 ++- .../spring/boot/starter/TelemetryNonPaIT.java | 2 +- .../bpm/spring/boot/starter/TelemetryPaIT.java | 3 ++- 8 files changed, 36 insertions(+), 21 deletions(-) diff --git a/engine/.clirr-jenkins-ignore.xml b/engine/.clirr-jenkins-ignore.xml index 5b48ccef734..42028dd87ad 100644 --- a/engine/.clirr-jenkins-ignore.xml +++ b/engine/.clirr-jenkins-ignore.xml @@ -101,4 +101,20 @@ org/camunda/bpm/engine/ProcessEngineConfiguration **Jpa** + + + + + 6001 + org/camunda/bpm/engine/ProcessEngineConfiguration + telemetryRegistry + + + + > + 7002 + org/camunda/bpm/engine/ProcessEngineConfiguration + **Telemetry** + + diff --git a/engine/src/main/java/org/camunda/bpm/engine/ProcessEngineConfiguration.java b/engine/src/main/java/org/camunda/bpm/engine/ProcessEngineConfiguration.java index 0749f101de4..7a78e9fbd95 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/ProcessEngineConfiguration.java +++ b/engine/src/main/java/org/camunda/bpm/engine/ProcessEngineConfiguration.java @@ -29,7 +29,6 @@ import org.camunda.bpm.engine.impl.cfg.BeansConfigurationHelper; import org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration; import org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration; -import org.camunda.bpm.engine.impl.diagnostics.DiagnosticsRegistry; import org.camunda.bpm.engine.impl.persistence.entity.JobEntity; import org.camunda.bpm.engine.runtime.DeserializationTypeValidator; import org.camunda.bpm.engine.variable.type.ValueTypeResolver; @@ -412,8 +411,6 @@ public abstract class ProcessEngineConfiguration { /** An unique installation identifier */ protected String installationId; - protected DiagnosticsRegistry diagnosticsRegistry; - /** * On failing activities we can skip output mapping. This might be helpful if output mapping uses variables that might not * be available on failure (e.g. with external tasks or RPA tasks). @@ -1056,15 +1053,6 @@ public ProcessEngineConfiguration setInstallationId(String installationId) { return this; } - public DiagnosticsRegistry getDiagnosticsRegistry() { - return diagnosticsRegistry; - } - - public ProcessEngineConfiguration setDiagnosticsRegistry(DiagnosticsRegistry diagnosticsRegistry) { - this.diagnosticsRegistry = diagnosticsRegistry; - return this; - } - public boolean isSkipOutputMappingOnCanceledActivities() { return skipOutputMappingOnCanceledActivities; } diff --git a/engine/src/main/java/org/camunda/bpm/engine/impl/ManagementServiceImpl.java b/engine/src/main/java/org/camunda/bpm/engine/impl/ManagementServiceImpl.java index 66e08b5447b..10f2c872c78 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/impl/ManagementServiceImpl.java +++ b/engine/src/main/java/org/camunda/bpm/engine/impl/ManagementServiceImpl.java @@ -683,7 +683,7 @@ public TelemetryData getTelemetryData() { * @return whether the web application was successfully added or not */ public boolean addWebappToTelemetry(String webapp) { - DiagnosticsRegistry telemetryRegistry = processEngineConfiguration.getDiagnosticsRegistry(); + DiagnosticsRegistry telemetryRegistry = ((ProcessEngineConfigurationImpl) processEngineConfiguration).getDiagnosticsRegistry(); if (telemetryRegistry != null) { telemetryRegistry.addWebapp(webapp); return true; @@ -698,7 +698,7 @@ public boolean addWebappToTelemetry(String webapp) { * a String containing information about the application server */ public void addApplicationServerInfoToTelemetry(String appServerInfo) { - DiagnosticsRegistry telemetryRegistry = processEngineConfiguration.getDiagnosticsRegistry(); + DiagnosticsRegistry telemetryRegistry = ((ProcessEngineConfigurationImpl) processEngineConfiguration).getDiagnosticsRegistry(); if (telemetryRegistry != null) { telemetryRegistry.setApplicationServer(appServerInfo); } @@ -712,14 +712,14 @@ public void addApplicationServerInfoToTelemetry(String appServerInfo) { * about the installed license */ public void setLicenseKeyForDiagnostics(LicenseKeyDataImpl licenseKeyData) { - DiagnosticsRegistry diagnosticsRegistry = processEngineConfiguration.getDiagnosticsRegistry(); + DiagnosticsRegistry diagnosticsRegistry = ((ProcessEngineConfigurationImpl) processEngineConfiguration).getDiagnosticsRegistry(); if (diagnosticsRegistry != null) { diagnosticsRegistry.setLicenseKey(licenseKeyData); } } public LicenseKeyDataImpl getLicenseKeyFromDiagnostics() { - DiagnosticsRegistry diagnosticsRegistry = processEngineConfiguration.getDiagnosticsRegistry(); + DiagnosticsRegistry diagnosticsRegistry = ((ProcessEngineConfigurationImpl) processEngineConfiguration).getDiagnosticsRegistry(); if (diagnosticsRegistry != null) { return diagnosticsRegistry.getLicenseKey(); } @@ -727,7 +727,7 @@ public LicenseKeyDataImpl getLicenseKeyFromDiagnostics() { } public void clearDiagnosticsData() { - DiagnosticsRegistry diagnosticsRegistry = processEngineConfiguration.getDiagnosticsRegistry(); + DiagnosticsRegistry diagnosticsRegistry = ((ProcessEngineConfigurationImpl) processEngineConfiguration).getDiagnosticsRegistry(); if (diagnosticsRegistry != null) { diagnosticsRegistry.clear(); } diff --git a/engine/src/main/java/org/camunda/bpm/engine/impl/cfg/ProcessEngineConfigurationImpl.java b/engine/src/main/java/org/camunda/bpm/engine/impl/cfg/ProcessEngineConfigurationImpl.java index 2b1236c11c9..a2f23b1b152 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/impl/cfg/ProcessEngineConfigurationImpl.java +++ b/engine/src/main/java/org/camunda/bpm/engine/impl/cfg/ProcessEngineConfigurationImpl.java @@ -1040,6 +1040,7 @@ public abstract class ProcessEngineConfigurationImpl extends ProcessEngineConfig // diagnostics /////////////////////////////////////////////////////// protected DiagnosticsCollector diagnosticsCollector; protected TelemetryDataImpl telemetryData; + protected DiagnosticsRegistry diagnosticsRegistry; // Exception Codes /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -5343,4 +5344,12 @@ protected ExceptionCodeInterceptor getExceptionCodeInterceptor() { return new ExceptionCodeInterceptor(builtinExceptionCodeProvider, customExceptionCodeProvider); } + public DiagnosticsRegistry getDiagnosticsRegistry() { + return diagnosticsRegistry; + } + + public ProcessEngineConfiguration setDiagnosticsRegistry(DiagnosticsRegistry diagnosticsRegistry) { + this.diagnosticsRegistry = diagnosticsRegistry; + return this; + } } diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/api/mgmt/telemetry/TelemetryDynamicDataTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/api/mgmt/telemetry/TelemetryDynamicDataTest.java index 6db2d39416e..59919c48cdc 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/api/mgmt/telemetry/TelemetryDynamicDataTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/api/mgmt/telemetry/TelemetryDynamicDataTest.java @@ -96,7 +96,7 @@ public void shouldCountCommandsFromEngineStartAfterTelemetryActivation() { .buildProcessEngine(); // then - DiagnosticsRegistry telemetryRegistry = processEngineInMem.getProcessEngineConfiguration().getDiagnosticsRegistry(); + DiagnosticsRegistry telemetryRegistry = ((ProcessEngineConfigurationImpl) processEngineInMem.getProcessEngineConfiguration()).getDiagnosticsRegistry(); Map entries = telemetryRegistry.getCommands(); // note: There are more commands executed during engine start, but the // telemetry registry (including the command counts) is reset when telemetry is activated diff --git a/spring-boot-starter/starter-qa/integration-test-simple/src/test/java/org/camunda/bpm/springboot/project/qa/simple/SimpleApplicationIT.java b/spring-boot-starter/starter-qa/integration-test-simple/src/test/java/org/camunda/bpm/springboot/project/qa/simple/SimpleApplicationIT.java index ee0f7a278d7..067dd8358a8 100644 --- a/spring-boot-starter/starter-qa/integration-test-simple/src/test/java/org/camunda/bpm/springboot/project/qa/simple/SimpleApplicationIT.java +++ b/spring-boot-starter/starter-qa/integration-test-simple/src/test/java/org/camunda/bpm/springboot/project/qa/simple/SimpleApplicationIT.java @@ -20,6 +20,7 @@ import org.camunda.bpm.engine.ProcessEngine; import org.camunda.bpm.engine.RuntimeService; +import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; import org.camunda.bpm.engine.impl.diagnostics.DiagnosticsRegistry; import org.camunda.bpm.engine.impl.telemetry.dto.ApplicationServerImpl; import org.junit.Test; @@ -52,7 +53,7 @@ public void shouldStartApplicationSuccessfully() { @Test public void shouldNotDetermineApplicationServer() { - DiagnosticsRegistry diagnosticsRegistry = processEngine.getProcessEngineConfiguration().getDiagnosticsRegistry(); + DiagnosticsRegistry diagnosticsRegistry = ((ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration()).getDiagnosticsRegistry(); // then ApplicationServerImpl applicationServer = diagnosticsRegistry.getApplicationServer(); diff --git a/spring-boot-starter/starter/src/test/java/org/camunda/bpm/spring/boot/starter/TelemetryNonPaIT.java b/spring-boot-starter/starter/src/test/java/org/camunda/bpm/spring/boot/starter/TelemetryNonPaIT.java index 512acb03d08..8d4dc9fa470 100644 --- a/spring-boot-starter/starter/src/test/java/org/camunda/bpm/spring/boot/starter/TelemetryNonPaIT.java +++ b/spring-boot-starter/starter/src/test/java/org/camunda/bpm/spring/boot/starter/TelemetryNonPaIT.java @@ -41,7 +41,7 @@ public class TelemetryNonPaIT extends AbstractCamundaAutoConfigurationIT { @Test public void shouldSubmitApplicationServerData() { - DiagnosticsRegistry diagnosticsRegistry = processEngine.getProcessEngineConfiguration().getDiagnosticsRegistry(); + DiagnosticsRegistry diagnosticsRegistry = ((ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration()).getDiagnosticsRegistry(); // then ApplicationServerImpl applicationServer = diagnosticsRegistry.getApplicationServer(); diff --git a/spring-boot-starter/starter/src/test/java/org/camunda/bpm/spring/boot/starter/TelemetryPaIT.java b/spring-boot-starter/starter/src/test/java/org/camunda/bpm/spring/boot/starter/TelemetryPaIT.java index 07cfd819244..877ad44ff37 100644 --- a/spring-boot-starter/starter/src/test/java/org/camunda/bpm/spring/boot/starter/TelemetryPaIT.java +++ b/spring-boot-starter/starter/src/test/java/org/camunda/bpm/spring/boot/starter/TelemetryPaIT.java @@ -18,6 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat; +import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; import org.camunda.bpm.engine.impl.diagnostics.DiagnosticsRegistry; import org.camunda.bpm.engine.impl.telemetry.dto.ApplicationServerImpl; import org.camunda.bpm.spring.boot.starter.test.pa.TestProcessApplication; @@ -38,7 +39,7 @@ public class TelemetryPaIT extends AbstractCamundaAutoConfigurationIT { @Test public void shouldSubmitApplicationServerData() { - DiagnosticsRegistry diagnosticsRegistry = processEngine.getProcessEngineConfiguration().getDiagnosticsRegistry(); + DiagnosticsRegistry diagnosticsRegistry = ((ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration()).getDiagnosticsRegistry(); // then ApplicationServerImpl applicationServer = diagnosticsRegistry.getApplicationServer();