Skip to content

Commit

Permalink
Merge pull request #80 from dgzpg/feature/metrics
Browse files Browse the repository at this point in the history
update pom version
  • Loading branch information
dgzpg authored Dec 7, 2021
2 parents 6019711 + 044862a commit b649a3d
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>capa-parent</artifactId>
<groupId>group.rxcloud</groupId>
<version>1.0.9.RELEASE</version>
<version>1.10.9.2.RELEASE</version>
</parent>

<artifactId>capa-examples</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<groupId>group.rxcloud</groupId>
<artifactId>capa-parent</artifactId>
<packaging>pom</packaging>
<version>1.0.9.RELEASE</version>
<version>1.10.9.2.RELEASE</version>
<name>capa-sdk-parent</name>
<description>SDK for Capa.</description>
<url>https://github.com/reactivegroup</url>
Expand Down
2 changes: 1 addition & 1 deletion sdk-component/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>group.rxcloud</groupId>
<artifactId>capa-parent</artifactId>
<version>1.0.9.RELEASE</version>
<version>1.10.9.2.RELEASE</version>
</parent>

<artifactId>capa-sdk-component</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,4 @@ public ConfigurationHooks provideConfigurationHooks() {
public TelemetryHooks provideTelemetryHooks() {
return null;
}


}
2 changes: 1 addition & 1 deletion sdk-infrastructure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>capa-parent</artifactId>
<groupId>group.rxcloud</groupId>
<version>1.0.9.RELEASE</version>
<version>1.10.9.2.RELEASE</version>
</parent>

<artifactId>capa-sdk-infrastructure</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package group.rxcloud.capa.infrastructure.hook;

import group.rxcloud.capa.infrastructure.CapaClassLoader;
import io.vavr.Lazy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -30,15 +31,15 @@ public abstract class Mixer {

private static final Logger logger = LoggerFactory.getLogger(Mixer.class);

private static ConfigurationHooks configurationHooks;
private static TelemetryHooks telemetryHooks;
private static Lazy<ConfigurationHooks> configurationHooks;
private static Lazy<TelemetryHooks> telemetryHooks;

static {
try {
MixerProvider mixerProvider = CapaClassLoader.loadInfrastructureClassObj("mixer", MixerProvider.class);
if (mixerProvider != null) {
registerConfigurationHooks(mixerProvider.provideConfigurationHooks());
registerTelemetryHooks(mixerProvider.provideTelemetryHooks());
registerConfigurationHooks(Lazy.of(mixerProvider::provideConfigurationHooks));
registerTelemetryHooks(Lazy.of(mixerProvider::provideTelemetryHooks));
}
} catch (Exception e) {
logger.info("[CapaMixer] load empty mixer. expected error: ", e);
Expand Down Expand Up @@ -70,7 +71,7 @@ public interface MixerProvider {
*
* @param configurationHooks the configuration hooks
*/
private static void registerConfigurationHooks(ConfigurationHooks configurationHooks) {
private static void registerConfigurationHooks(Lazy<ConfigurationHooks> configurationHooks) {
Mixer.configurationHooks = configurationHooks;
}

Expand All @@ -79,7 +80,7 @@ private static void registerConfigurationHooks(ConfigurationHooks configurationH
*
* @param telemetryHooks the telemetry hooks
*/
private static void registerTelemetryHooks(TelemetryHooks telemetryHooks) {
private static void registerTelemetryHooks(Lazy<TelemetryHooks> telemetryHooks) {
Mixer.telemetryHooks = telemetryHooks;
}

Expand All @@ -90,7 +91,9 @@ private static void registerTelemetryHooks(TelemetryHooks telemetryHooks) {
*/
@Nullable
public static ConfigurationHooks configurationHooks() {
return configurationHooks;
return configurationHooks != null
? configurationHooks.get()
: null;
}

/**
Expand All @@ -99,7 +102,7 @@ public static ConfigurationHooks configurationHooks() {
* @return the configuration hooks
*/
public static Optional<ConfigurationHooks> configurationHooksNullable() {
return Optional.ofNullable(configurationHooks);
return Optional.ofNullable(configurationHooks.get());
}

/**
Expand All @@ -109,7 +112,9 @@ public static Optional<ConfigurationHooks> configurationHooksNullable() {
*/
@Nullable
public static TelemetryHooks telemetryHooks() {
return telemetryHooks;
return telemetryHooks != null
? telemetryHooks.get()
: null;
}

/**
Expand All @@ -118,6 +123,6 @@ public static TelemetryHooks telemetryHooks() {
* @return the telemetry hooks
*/
public static Optional<TelemetryHooks> telemetryHooksNullable() {
return Optional.ofNullable(telemetryHooks);
return Optional.ofNullable(telemetryHooks.get());
}
}
2 changes: 1 addition & 1 deletion sdk-spi-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>capa-parent</artifactId>
<groupId>group.rxcloud</groupId>
<version>1.0.9.RELEASE</version>
<version>1.10.9.2.RELEASE</version>
</parent>

<artifactId>capa-sdk-spi-demo</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sdk-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>capa-parent</artifactId>
<groupId>group.rxcloud</groupId>
<version>1.0.9.RELEASE</version>
<version>1.10.9.2.RELEASE</version>
</parent>

<artifactId>capa-sdk-spi</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sdk-springboot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>capa-parent</artifactId>
<groupId>group.rxcloud</groupId>
<version>1.0.9.RELEASE</version>
<version>1.10.9.2.RELEASE</version>
</parent>

<artifactId>sdk-springboot</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>group.rxcloud</groupId>
<artifactId>capa-parent</artifactId>
<version>1.0.9.RELEASE</version>
<version>1.10.9.2.RELEASE</version>
</parent>

<artifactId>capa-sdk</artifactId>
Expand Down

0 comments on commit b649a3d

Please sign in to comment.