Skip to content

Commit

Permalink
[apache#4560]change return type of create method in DynamicProperties…
Browse files Browse the repository at this point in the history
…Source(apache#4561)
  • Loading branch information
yinhaox authored Oct 17, 2024
1 parent b41c208 commit 664d314
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.PropertySource;

public class ApolloDynamicPropertiesSource implements DynamicPropertiesSource {
public static final String SOURCE_NAME = "apollo";
Expand Down Expand Up @@ -75,7 +76,7 @@ public void handle(ConfigurationAction action, Map<String, Object> config) {
}

@Override
public MapPropertySource create(Environment environment) {
public PropertySource<?> create(Environment environment) {
init(environment);
return new MapPropertySource(SOURCE_NAME, valueCache);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.PropertySource;

import com.google.common.eventbus.Subscribe;

Expand Down Expand Up @@ -181,7 +182,7 @@ private ConfigCenterAddressManager configCenterAddressManager(ConfigCenterConfig
}

@Override
public MapPropertySource create(Environment environment) {
public PropertySource<?> create(Environment environment) {
init(environment);
return new MapPropertySource(SOURCE_NAME, data);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.PropertySource;

import com.google.common.eventbus.Subscribe;

Expand Down Expand Up @@ -163,7 +164,7 @@ private KieAddressManager configKieAddressManager(KieConfig kieConfig) {
}

@Override
public MapPropertySource create(Environment environment) {
public PropertySource<?> create(Environment environment) {
init(environment);
return new MapPropertySource(SOURCE_NAME, data);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.PropertySource;

public class NacosDynamicPropertiesSource implements DynamicPropertiesSource {
public static final String SOURCE_NAME = "nacos";
Expand Down Expand Up @@ -60,7 +61,7 @@ public void handle(Map<String, Object> current, Map<String, Object> last) {
}

@Override
public MapPropertySource create(Environment environment) {
public PropertySource<?> create(Environment environment) {
init(environment);
return new MapPropertySource(SOURCE_NAME, valueCache);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.PropertySource;

public class ZookeeperDynamicPropertiesSource implements DynamicPropertiesSource {
public static final String SOURCE_NAME = "zookeeper";
Expand Down Expand Up @@ -60,7 +61,7 @@ public void handle(Map<String, Object> current, Map<String, Object> last) {
}

@Override
public MapPropertySource create(Environment environment) {
public PropertySource<?> create(Environment environment) {
init(environment);
return new MapPropertySource(SOURCE_NAME, valueCache);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

import org.springframework.core.Ordered;
import org.springframework.core.env.Environment;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.PropertySource;

/**
* SPI to add new DynamicPropertiesSource.
*/
public interface DynamicPropertiesSource extends Ordered {
MapPropertySource create(Environment environment);
PropertySource<?> create(Environment environment);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.servicecomb.foundation.common.event.EventManager;
import org.springframework.core.env.Environment;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.env.PropertySource;

/**
* This DynamicPropertiesSource is created for easier system tests.
Expand All @@ -32,7 +33,7 @@ public class InMemoryDynamicPropertiesSource implements DynamicPropertiesSource
private static final Map<String, Object> DYNAMIC = new HashMap<>();

@Override
public MapPropertySource create(Environment environment) {
public PropertySource<?> create(Environment environment) {
return new MapPropertySource(SOURCE_NAME, DYNAMIC);
}

Expand Down

0 comments on commit 664d314

Please sign in to comment.