Skip to content

Commit

Permalink
move registry to Impl
Browse files Browse the repository at this point in the history
  • Loading branch information
yanavasileva committed Jul 15, 2024
1 parent 2bbe663 commit 85aba6b
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 21 deletions.
16 changes: 16 additions & 0 deletions engine/.clirr-jenkins-ignore.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,20 @@
<className>org/camunda/bpm/engine/ProcessEngineConfiguration</className>
<method>**Jpa**</method>
</difference>

<!-- 6001: removed field -->
<!-- removed feature: sending telemetry-->
<difference>
<differenceType>6001</differenceType>
<className>org/camunda/bpm/engine/ProcessEngineConfiguration</className>
<field>telemetryRegistry</field>
</difference>
<!-- 7002: removed method -->
<!-- removed feature: sending telemetry -->
<difference>>
<differenceType>7002</differenceType>
<className>org/camunda/bpm/engine/ProcessEngineConfiguration</className>
<method>**Telemetry**</method>
</difference>

</differences>
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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).
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand All @@ -712,22 +712,22 @@ 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();
}
return null;
}

public void clearDiagnosticsData() {
DiagnosticsRegistry diagnosticsRegistry = processEngineConfiguration.getDiagnosticsRegistry();
DiagnosticsRegistry diagnosticsRegistry = ((ProcessEngineConfigurationImpl) processEngineConfiguration).getDiagnosticsRegistry();
if (diagnosticsRegistry != null) {
diagnosticsRegistry.clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,7 @@ public abstract class ProcessEngineConfigurationImpl extends ProcessEngineConfig
// diagnostics ///////////////////////////////////////////////////////
protected DiagnosticsCollector diagnosticsCollector;
protected TelemetryDataImpl telemetryData;
protected DiagnosticsRegistry diagnosticsRegistry;

// Exception Codes ///////////////////////////////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void shouldCountCommandsFromEngineStartAfterTelemetryActivation() {
.buildProcessEngine();

// then
DiagnosticsRegistry telemetryRegistry = processEngineInMem.getProcessEngineConfiguration().getDiagnosticsRegistry();
DiagnosticsRegistry telemetryRegistry = ((ProcessEngineConfigurationImpl) processEngineInMem.getProcessEngineConfiguration()).getDiagnosticsRegistry();
Map<String, CommandCounter> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down

0 comments on commit 85aba6b

Please sign in to comment.