diff --git a/apollo-adminservice/pom.xml b/apollo-adminservice/pom.xml index d9a77ddbc923f4c135ccd1e43ae62942985d2aa9..ece4e6ee8ef993373c4ea340ffcc7a59610851af 100644 --- a/apollo-adminservice/pom.xml +++ b/apollo-adminservice/pom.xml @@ -4,7 +4,7 @@ com.ctrip.framework.apollo apollo - 0.10.0 + 0.10.1 ../pom.xml 4.0.0 diff --git a/apollo-adminservice/src/main/docker/Dockerfile b/apollo-adminservice/src/main/docker/Dockerfile index 1043fa838cc9b90f1a919032fc6f842f24c18d85..a31c13da5f5d59a3549a6dec62d271182c34c7b7 100755 --- a/apollo-adminservice/src/main/docker/Dockerfile +++ b/apollo-adminservice/src/main/docker/Dockerfile @@ -7,7 +7,7 @@ FROM openjdk:8-jre-alpine MAINTAINER ameizi -ENV VERSION 0.10.0 +ENV VERSION 0.10.1 RUN echo "http://mirrors.aliyun.com/alpine/v3.6/main" > /etc/apk/repositories \ && echo "http://mirrors.aliyun.com/alpine/v3.6/community" >> /etc/apk/repositories \ diff --git a/apollo-assembly/pom.xml b/apollo-assembly/pom.xml index f5314c8b20f08d29f5c05577331ae34c975584fa..f47dc329dd623a18be609b8dd74ee7c7102dc6f9 100644 --- a/apollo-assembly/pom.xml +++ b/apollo-assembly/pom.xml @@ -4,7 +4,7 @@ com.ctrip.framework.apollo apollo - 0.10.0 + 0.10.1 ../pom.xml 4.0.0 diff --git a/apollo-biz/pom.xml b/apollo-biz/pom.xml index 9fd588c2395b0e6c64f93d1cc49262b8dd948967..38673f47a4f258b2dcc1267b54c4515cc021f2a5 100644 --- a/apollo-biz/pom.xml +++ b/apollo-biz/pom.xml @@ -4,7 +4,7 @@ com.ctrip.framework.apollo apollo - 0.10.0 + 0.10.1 4.0.0 apollo-biz diff --git a/apollo-buildtools/pom.xml b/apollo-buildtools/pom.xml index 1e7bd9631f8e6162ea4220c4befe7d62049e6026..09921038019bd8d88b1e166e8f7b7eb58e19bdcf 100644 --- a/apollo-buildtools/pom.xml +++ b/apollo-buildtools/pom.xml @@ -4,7 +4,7 @@ com.ctrip.framework.apollo apollo - 0.10.0 + 0.10.1 ../pom.xml 4.0.0 diff --git a/apollo-client/README.md b/apollo-client/README.md index 7245949383a24f0b9fbdb8fb06f06e47f81a361d..7e8b6be074a3b9ed8a433a32b1af70084c62c13d 100644 --- a/apollo-client/README.md +++ b/apollo-client/README.md @@ -88,7 +88,7 @@ If you need this functionality, you could specify the cluster as follows: com.ctrip.framework.apollo apollo-client - 0.10.0 + 0.10.1 ## III. Client Usage diff --git a/apollo-client/pom.xml b/apollo-client/pom.xml index b2d157e85bbcaa483f528b50b8811a6a5f4aa7b0..091aad26d767ea71c156402fbe1fc4ac0f23a6fc 100644 --- a/apollo-client/pom.xml +++ b/apollo-client/pom.xml @@ -4,7 +4,7 @@ com.ctrip.framework.apollo apollo - 0.10.0 + 0.10.1 ../pom.xml 4.0.0 diff --git a/apollo-client/src/main/java/com/ctrip/framework/apollo/build/ApolloInjector.java b/apollo-client/src/main/java/com/ctrip/framework/apollo/build/ApolloInjector.java index 62177eebb8b16a61c7c91fbe8a8e6f0f59d3da49..0bdb4851478fa3be97d8670cc5b8f60df09d7e55 100644 --- a/apollo-client/src/main/java/com/ctrip/framework/apollo/build/ApolloInjector.java +++ b/apollo-client/src/main/java/com/ctrip/framework/apollo/build/ApolloInjector.java @@ -10,7 +10,7 @@ import com.ctrip.framework.foundation.internals.ServiceBootstrap; */ public class ApolloInjector { private static volatile Injector s_injector; - private static Object lock = new Object(); + private static final Object lock = new Object(); private static Injector getInjector() { if (s_injector == null) { diff --git a/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/DefaultInjector.java b/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/DefaultInjector.java index 88f160f876a96cba67832c8af8eff36270404073..46e935ff7f8355d34f9b9303c24ec01e5f404a10 100644 --- a/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/DefaultInjector.java +++ b/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/DefaultInjector.java @@ -7,9 +7,6 @@ import com.ctrip.framework.apollo.spi.ConfigRegistry; import com.ctrip.framework.apollo.spi.DefaultConfigFactory; import com.ctrip.framework.apollo.spi.DefaultConfigFactoryManager; import com.ctrip.framework.apollo.spi.DefaultConfigRegistry; -import com.ctrip.framework.apollo.spring.config.ConfigPropertySourceFactory; -import com.ctrip.framework.apollo.spring.property.PlaceholderHelper; -import com.ctrip.framework.apollo.spring.property.SpringValueRegistry; import com.ctrip.framework.apollo.tracer.Tracer; import com.ctrip.framework.apollo.util.ConfigUtil; import com.ctrip.framework.apollo.util.http.HttpUtil; @@ -63,9 +60,6 @@ public class DefaultInjector implements Injector { bind(HttpUtil.class).in(Singleton.class); bind(ConfigServiceLocator.class).in(Singleton.class); bind(RemoteConfigLongPollService.class).in(Singleton.class); - bind(PlaceholderHelper.class).in(Singleton.class); - bind(ConfigPropertySourceFactory.class).in(Singleton.class); - bind(SpringValueRegistry.class).in(Singleton.class); } } } diff --git a/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/annotation/ApolloJsonValueProcessor.java b/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/annotation/ApolloJsonValueProcessor.java index 3ab48646cf12d9b163d1f611a5f322828aef65cb..c64f14560a59cb78170c8bbd461a337d78ac6dd6 100644 --- a/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/annotation/ApolloJsonValueProcessor.java +++ b/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/annotation/ApolloJsonValueProcessor.java @@ -5,6 +5,7 @@ import com.ctrip.framework.apollo.spring.property.AutoUpdateConfigChangeListener import com.ctrip.framework.apollo.spring.property.PlaceholderHelper; import com.ctrip.framework.apollo.spring.property.SpringValue; import com.ctrip.framework.apollo.spring.property.SpringValueRegistry; +import com.ctrip.framework.apollo.spring.util.SpringInjector; import com.ctrip.framework.apollo.util.ConfigUtil; import com.google.common.base.Preconditions; import com.google.gson.Gson; @@ -37,8 +38,8 @@ public class ApolloJsonValueProcessor extends ApolloProcessor implements BeanFac public ApolloJsonValueProcessor() { configUtil = ApolloInjector.getInstance(ConfigUtil.class); - placeholderHelper = ApolloInjector.getInstance(PlaceholderHelper.class); - springValueRegistry = ApolloInjector.getInstance(SpringValueRegistry.class); + placeholderHelper = SpringInjector.getInstance(PlaceholderHelper.class); + springValueRegistry = SpringInjector.getInstance(SpringValueRegistry.class); } @Override diff --git a/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/annotation/SpringValueProcessor.java b/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/annotation/SpringValueProcessor.java index efe1076ca772e339772b27cc26f506c4b65ad964..bdcd554c5fa73807f7b91b82cd8d11d377a894cc 100644 --- a/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/annotation/SpringValueProcessor.java +++ b/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/annotation/SpringValueProcessor.java @@ -7,6 +7,7 @@ import com.ctrip.framework.apollo.spring.property.SpringValue; import com.ctrip.framework.apollo.spring.property.SpringValueDefinition; import com.ctrip.framework.apollo.spring.property.SpringValueDefinitionProcessor; import com.ctrip.framework.apollo.spring.property.SpringValueRegistry; +import com.ctrip.framework.apollo.spring.util.SpringInjector; import com.ctrip.framework.apollo.util.ConfigUtil; import com.google.common.collect.LinkedListMultimap; import com.google.common.collect.Multimap; @@ -43,8 +44,8 @@ public class SpringValueProcessor extends ApolloProcessor implements BeanFactory public SpringValueProcessor() { configUtil = ApolloInjector.getInstance(ConfigUtil.class); - placeholderHelper = ApolloInjector.getInstance(PlaceholderHelper.class); - springValueRegistry = ApolloInjector.getInstance(SpringValueRegistry.class); + placeholderHelper = SpringInjector.getInstance(PlaceholderHelper.class); + springValueRegistry = SpringInjector.getInstance(SpringValueRegistry.class); } @Override diff --git a/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/boot/ApolloApplicationContextInitializer.java b/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/boot/ApolloApplicationContextInitializer.java index 4f7b2640f41cddc037ef00c3dec01f35007ade33..c9d2ea64f8f0cd2798085c6decc4062372233e84 100644 --- a/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/boot/ApolloApplicationContextInitializer.java +++ b/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/boot/ApolloApplicationContextInitializer.java @@ -6,6 +6,7 @@ import com.ctrip.framework.apollo.build.ApolloInjector; import com.ctrip.framework.apollo.core.ConfigConsts; import com.ctrip.framework.apollo.spring.config.ConfigPropertySourceFactory; import com.ctrip.framework.apollo.spring.config.PropertySourcesConstants; +import com.ctrip.framework.apollo.spring.util.SpringInjector; import com.google.common.base.Splitter; import java.util.List; import org.slf4j.Logger; @@ -37,7 +38,7 @@ public class ApolloApplicationContextInitializer implements private static final Logger logger = LoggerFactory.getLogger(ApolloApplicationContextInitializer.class); private static final Splitter NAMESPACE_SPLITTER = Splitter.on(",").omitEmptyStrings().trimResults(); - private final ConfigPropertySourceFactory configPropertySourceFactory = ApolloInjector + private final ConfigPropertySourceFactory configPropertySourceFactory = SpringInjector .getInstance(ConfigPropertySourceFactory.class); @Override diff --git a/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/config/PropertySourcesProcessor.java b/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/config/PropertySourcesProcessor.java index 362dee589a6d3da092d594ffe951f9121bcc4211..b6794dddf4c92215a0c93b762a2bd227ac3f4599 100644 --- a/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/config/PropertySourcesProcessor.java +++ b/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/config/PropertySourcesProcessor.java @@ -2,6 +2,7 @@ package com.ctrip.framework.apollo.spring.config; import com.ctrip.framework.apollo.build.ApolloInjector; import com.ctrip.framework.apollo.spring.property.AutoUpdateConfigChangeListener; +import com.ctrip.framework.apollo.spring.util.SpringInjector; import com.ctrip.framework.apollo.util.ConfigUtil; import com.google.common.collect.ImmutableSortedSet; import com.google.common.collect.LinkedHashMultimap; @@ -39,7 +40,7 @@ public class PropertySourcesProcessor implements BeanFactoryPostProcessor, Envir private static final Multimap NAMESPACE_NAMES = LinkedHashMultimap.create(); private static final AtomicBoolean INITIALIZED = new AtomicBoolean(false); - private final ConfigPropertySourceFactory configPropertySourceFactory = ApolloInjector + private final ConfigPropertySourceFactory configPropertySourceFactory = SpringInjector .getInstance(ConfigPropertySourceFactory.class); private final ConfigUtil configUtil = ApolloInjector.getInstance(ConfigUtil.class); private ConfigurableEnvironment environment; diff --git a/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/property/AutoUpdateConfigChangeListener.java b/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/property/AutoUpdateConfigChangeListener.java index 0ee7b18ac0bbc7a1456bddcd6159d13891b8f875..8e03db480997cbbe493b941c58f478515b653aa6 100644 --- a/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/property/AutoUpdateConfigChangeListener.java +++ b/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/property/AutoUpdateConfigChangeListener.java @@ -6,6 +6,7 @@ import com.ctrip.framework.apollo.enums.PropertyChangeType; import com.ctrip.framework.apollo.model.ConfigChange; import com.ctrip.framework.apollo.model.ConfigChangeEvent; import com.ctrip.framework.apollo.spring.annotation.SpringValueProcessor; +import com.ctrip.framework.apollo.spring.util.SpringInjector; import com.google.gson.Gson; import java.lang.reflect.Field; import java.lang.reflect.Type; @@ -39,8 +40,8 @@ public class AutoUpdateConfigChangeListener implements ConfigChangeListener{ this.beanFactory = beanFactory; this.typeConverter = this.beanFactory.getTypeConverter(); this.environment = environment; - this.placeholderHelper = ApolloInjector.getInstance(PlaceholderHelper.class); - this.springValueRegistry = ApolloInjector.getInstance(SpringValueRegistry.class); + this.placeholderHelper = SpringInjector.getInstance(PlaceholderHelper.class); + this.springValueRegistry = SpringInjector.getInstance(SpringValueRegistry.class); this.gson = new Gson(); } diff --git a/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/property/SpringValueDefinitionProcessor.java b/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/property/SpringValueDefinitionProcessor.java index 4d44b266cef629bfb4feb9741a40d8c7757b1e3a..b1ce51abc8bfa826732ea25b07c25bba96015d3d 100644 --- a/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/property/SpringValueDefinitionProcessor.java +++ b/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/property/SpringValueDefinitionProcessor.java @@ -1,5 +1,6 @@ package com.ctrip.framework.apollo.spring.property; +import com.ctrip.framework.apollo.spring.util.SpringInjector; import java.util.List; import java.util.Set; @@ -38,7 +39,7 @@ public class SpringValueDefinitionProcessor implements BeanDefinitionRegistryPos public SpringValueDefinitionProcessor() { configUtil = ApolloInjector.getInstance(ConfigUtil.class); - placeholderHelper = ApolloInjector.getInstance(PlaceholderHelper.class); + placeholderHelper = SpringInjector.getInstance(PlaceholderHelper.class); } @Override diff --git a/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/util/SpringInjector.java b/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/util/SpringInjector.java new file mode 100644 index 0000000000000000000000000000000000000000..4b9004081c17958859d33829db2c1d163c7a49b8 --- /dev/null +++ b/apollo-client/src/main/java/com/ctrip/framework/apollo/spring/util/SpringInjector.java @@ -0,0 +1,53 @@ +package com.ctrip.framework.apollo.spring.util; + +import com.ctrip.framework.apollo.exceptions.ApolloConfigException; +import com.ctrip.framework.apollo.spring.config.ConfigPropertySourceFactory; +import com.ctrip.framework.apollo.spring.property.PlaceholderHelper; +import com.ctrip.framework.apollo.spring.property.SpringValueRegistry; +import com.ctrip.framework.apollo.tracer.Tracer; +import com.google.inject.AbstractModule; +import com.google.inject.Guice; +import com.google.inject.Injector; +import com.google.inject.Singleton; + +public class SpringInjector { + private static volatile Injector s_injector; + private static final Object lock = new Object(); + + private static Injector getInjector() { + if (s_injector == null) { + synchronized (lock) { + if (s_injector == null) { + try { + s_injector = Guice.createInjector(new SpringModule()); + } catch (Throwable ex) { + ApolloConfigException exception = new ApolloConfigException("Unable to initialize Apollo Spring Injector!", ex); + Tracer.logError(exception); + throw exception; + } + } + } + } + + return s_injector; + } + + public static T getInstance(Class clazz) { + try { + return getInjector().getInstance(clazz); + } catch (Throwable ex) { + Tracer.logError(ex); + throw new ApolloConfigException( + String.format("Unable to load instance for %s!", clazz.getName()), ex); + } + } + + private static class SpringModule extends AbstractModule { + @Override + protected void configure() { + bind(PlaceholderHelper.class).in(Singleton.class); + bind(ConfigPropertySourceFactory.class).in(Singleton.class); + bind(SpringValueRegistry.class).in(Singleton.class); + } + } +} diff --git a/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/JavaConfigPlaceholderAutoUpdateTest.java b/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/JavaConfigPlaceholderAutoUpdateTest.java index f0b898d2cd616e068a9d843f5c71314ce26f0cad..51683f1416030e995699ace47eb1b1d255138f63 100644 --- a/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/JavaConfigPlaceholderAutoUpdateTest.java +++ b/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/JavaConfigPlaceholderAutoUpdateTest.java @@ -65,7 +65,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(newTimeout, bean.getTimeout()); assertEquals(newBatch, bean.getBatch()); @@ -98,7 +98,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(newTimeout, javaConfigBean.getTimeout()); assertEquals(newBatch, javaConfigBean.getBatch()); @@ -135,7 +135,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(initialTimeout, bean.getTimeout()); assertEquals(initialBatch, bean.getBatch()); @@ -165,7 +165,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati applicationConfig.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newApplicationProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(newTimeout, bean.getTimeout()); assertEquals(initialBatch, bean.getBatch()); @@ -174,7 +174,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati fxApolloConfig.onRepositoryChange(FX_APOLLO_NAMESPACE, newFxApolloProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(newTimeout, bean.getTimeout()); assertEquals(newBatch, bean.getBatch()); @@ -192,7 +192,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati Properties fxApolloProperties = assembleProperties(TIMEOUT_PROPERTY, String.valueOf(someTimeout), BATCH_PROPERTY, String.valueOf(anotherBatch)); - SimpleConfig applicationConfig = prepareConfig(ConfigConsts.NAMESPACE_APPLICATION, applicationProperties); + prepareConfig(ConfigConsts.NAMESPACE_APPLICATION, applicationProperties); SimpleConfig fxApolloConfig = prepareConfig(FX_APOLLO_NAMESPACE, fxApolloProperties); AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig2.class); @@ -207,7 +207,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati fxApolloConfig.onRepositoryChange(FX_APOLLO_NAMESPACE, newFxApolloProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(someNewTimeout, bean.getTimeout()); assertEquals(someBatch, bean.getBatch()); @@ -235,7 +235,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati applicationConfig.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newApplicationProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(newTimeout, bean.getTimeout()); assertEquals(newBatch, bean.getBatch()); @@ -268,7 +268,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati applicationConfig.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newApplicationProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(initialTimeout, bean.getTimeout()); assertEquals(DEFAULT_BATCH, bean.getBatch()); @@ -295,7 +295,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(DEFAULT_TIMEOUT, bean.getTimeout()); assertEquals(DEFAULT_BATCH, bean.getBatch()); @@ -312,7 +312,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati assembleProperties(TIMEOUT_PROPERTY, String.valueOf(someTimeout), BATCH_PROPERTY, String.valueOf(anotherBatch)); SimpleConfig applicationConfig = prepareConfig(ConfigConsts.NAMESPACE_APPLICATION, applicationProperties); - SimpleConfig fxApolloConfig = prepareConfig(FX_APOLLO_NAMESPACE, fxApolloProperties); + prepareConfig(FX_APOLLO_NAMESPACE, fxApolloProperties); AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig2.class); @@ -325,7 +325,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati applicationConfig.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(someTimeout, bean.getTimeout()); assertEquals(anotherBatch, bean.getBatch()); @@ -353,7 +353,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(newTimeout, bean.getTimeout()); assertEquals(initialBatch, bean.getBatch()); @@ -383,7 +383,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(newTimeout, bean.getTimeout()); assertEquals(initialBatch, bean.getBatch()); @@ -413,7 +413,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); // Does not support this scenario assertEquals(initialTimeout, bean.getTimeout()); @@ -444,7 +444,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); // Does not support this scenario assertEquals(initialTimeout, bean.getTimeout()); @@ -475,7 +475,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); // Does not support this scenario assertEquals(initialTimeout, bean.getTimeout()); @@ -506,7 +506,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); // Does not support this scenario assertEquals(initialTimeout, bean.getTimeout()); @@ -537,7 +537,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(someNewValue, bean.getNestedProperty()); } @@ -565,7 +565,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); // Does not support this scenario assertEquals(someValue, bean.getNestedProperty()); @@ -594,7 +594,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(someNewValue, bean.getNestedProperty()); } @@ -631,7 +631,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(someNewValue, bean.getNestedProperty()); } @@ -713,7 +713,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(someNewInt, bean.getIntProperty()); assertArrayEquals(someNewIntArray, bean.getIntArrayProperty()); @@ -751,7 +751,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); // should not change anything assertTrue(jsonBean == bean.getJsonBean()); @@ -778,7 +778,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); // should not change anything assertTrue(jsonBean == bean.getJsonBean()); @@ -805,7 +805,7 @@ public class JavaConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegrati config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); JsonBean newJsonBean = bean.getJsonBean(); diff --git a/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/XmlConfigPlaceholderAutoUpdateTest.java b/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/XmlConfigPlaceholderAutoUpdateTest.java index 436130f78a23dae8b7726f1b74d6c429e775ad3b..1c5336f31a7c40b2dd303c13a7c56c51a8b02cee 100644 --- a/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/XmlConfigPlaceholderAutoUpdateTest.java +++ b/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/XmlConfigPlaceholderAutoUpdateTest.java @@ -49,7 +49,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(newTimeout, bean.getTimeout()); assertEquals(newBatch, bean.getBatch()); @@ -84,7 +84,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(initialTimeout, bean.getTimeout()); assertEquals(initialBatch, bean.getBatch()); @@ -119,7 +119,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio applicationConfig .onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newApplicationProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(newTimeout, bean.getTimeout()); assertEquals(initialBatch, bean.getBatch()); @@ -128,7 +128,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio fxApolloConfig.onRepositoryChange(FX_APOLLO_NAMESPACE, newFxApolloProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(newTimeout, bean.getTimeout()); assertEquals(newBatch, bean.getBatch()); @@ -147,8 +147,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio Properties fxApolloProperties = assembleProperties(TIMEOUT_PROPERTY, String.valueOf(someTimeout), BATCH_PROPERTY, String.valueOf(anotherBatch)); - SimpleConfig applicationConfig = prepareConfig(ConfigConsts.NAMESPACE_APPLICATION, - applicationProperties); + prepareConfig(ConfigConsts.NAMESPACE_APPLICATION, applicationProperties); SimpleConfig fxApolloConfig = prepareConfig(FX_APOLLO_NAMESPACE, fxApolloProperties); ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring/XmlConfigPlaceholderTest3.xml"); @@ -163,7 +162,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio fxApolloConfig.onRepositoryChange(FX_APOLLO_NAMESPACE, newFxApolloProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(someNewTimeout, bean.getTimeout()); assertEquals(someBatch, bean.getBatch()); @@ -194,7 +193,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio applicationConfig .onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newApplicationProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(newTimeout, bean.getTimeout()); assertEquals(newBatch, bean.getBatch()); @@ -229,7 +228,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio applicationConfig .onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newApplicationProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(initialTimeout, bean.getTimeout()); assertEquals(DEFAULT_BATCH, bean.getBatch()); @@ -256,7 +255,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(DEFAULT_TIMEOUT, bean.getTimeout()); assertEquals(DEFAULT_BATCH, bean.getBatch()); @@ -275,7 +274,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio SimpleConfig applicationConfig = prepareConfig(ConfigConsts.NAMESPACE_APPLICATION, applicationProperties); - SimpleConfig fxApolloConfig = prepareConfig(FX_APOLLO_NAMESPACE, fxApolloProperties); + prepareConfig(FX_APOLLO_NAMESPACE, fxApolloProperties); ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring/XmlConfigPlaceholderTest3.xml"); @@ -288,7 +287,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio applicationConfig.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(someTimeout, bean.getTimeout()); assertEquals(anotherBatch, bean.getBatch()); @@ -316,7 +315,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(newTimeout, bean.getTimeout()); assertEquals(initialBatch, bean.getBatch()); @@ -346,7 +345,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(newTimeout, bean.getTimeout()); assertEquals(initialBatch, bean.getBatch()); @@ -376,7 +375,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); // Does not support this scenario assertEquals(initialTimeout, bean.getTimeout()); @@ -407,7 +406,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(newTimeout, bean.getTimeout()); assertEquals(newBatch, bean.getBatch()); @@ -483,7 +482,7 @@ public class XmlConfigPlaceholderAutoUpdateTest extends AbstractSpringIntegratio config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); assertEquals(someNewInt, bean.getIntProperty()); assertArrayEquals(someNewIntArray, bean.getIntArrayProperty()); diff --git a/apollo-common/pom.xml b/apollo-common/pom.xml index 85ee2069e31260e29a9b376c9b94e9995c77bac5..3f45b6483696ddb4e750b0c5b87dbda87fcfd155 100644 --- a/apollo-common/pom.xml +++ b/apollo-common/pom.xml @@ -4,7 +4,7 @@ com.ctrip.framework.apollo apollo - 0.10.0 + 0.10.1 ../pom.xml 4.0.0 diff --git a/apollo-configservice/pom.xml b/apollo-configservice/pom.xml index 47aa4e562b97ed1c7ceef0758c8a7d916356741b..c68dbe3a18393cf6cdddb825c0740f04492675e7 100644 --- a/apollo-configservice/pom.xml +++ b/apollo-configservice/pom.xml @@ -4,7 +4,7 @@ com.ctrip.framework.apollo apollo - 0.10.0 + 0.10.1 ../pom.xml 4.0.0 diff --git a/apollo-configservice/src/main/docker/Dockerfile b/apollo-configservice/src/main/docker/Dockerfile index 36a9740c6dc4c7e238a9b9473cfdbbadba769073..3393d279594b5b0cc72e8a527d457b09239b8499 100755 --- a/apollo-configservice/src/main/docker/Dockerfile +++ b/apollo-configservice/src/main/docker/Dockerfile @@ -7,7 +7,7 @@ FROM openjdk:8-jre-alpine MAINTAINER ameizi -ENV VERSION 0.10.0 +ENV VERSION 0.10.1 RUN echo "http://mirrors.aliyun.com/alpine/v3.6/main" > /etc/apk/repositories \ && echo "http://mirrors.aliyun.com/alpine/v3.6/community" >> /etc/apk/repositories \ diff --git a/apollo-core/pom.xml b/apollo-core/pom.xml index 655107f6407f8f159c6681e27f18c17653929f5a..47d7b5ec2aa60fb6274e5716ee2951ab995d4d1b 100644 --- a/apollo-core/pom.xml +++ b/apollo-core/pom.xml @@ -4,7 +4,7 @@ com.ctrip.framework.apollo apollo - 0.10.0 + 0.10.1 ../pom.xml 4.0.0 diff --git a/apollo-demo/pom.xml b/apollo-demo/pom.xml index b896d44f5e7b8e690f5f411ce36540c4f85d780b..c527a334d536a9a84192be94dceddd55be93a726 100644 --- a/apollo-demo/pom.xml +++ b/apollo-demo/pom.xml @@ -4,7 +4,7 @@ apollo com.ctrip.framework.apollo - 0.10.0 + 0.10.1 4.0.0 apollo-demo diff --git a/apollo-portal/pom.xml b/apollo-portal/pom.xml index dd808e288299372029273a832d9855c852446b8f..0b0bd015c5c3370a2cf9b241308f345be98cbe83 100644 --- a/apollo-portal/pom.xml +++ b/apollo-portal/pom.xml @@ -4,7 +4,7 @@ com.ctrip.framework.apollo apollo - 0.10.0 + 0.10.1 ../pom.xml 4.0.0 diff --git a/apollo-portal/src/main/docker/Dockerfile b/apollo-portal/src/main/docker/Dockerfile index c4c2bc327e5ab64124037bb1e35a048b51ab7563..cf113ae3e64d9bf5f3357d9ed17869b6c4ae0381 100755 --- a/apollo-portal/src/main/docker/Dockerfile +++ b/apollo-portal/src/main/docker/Dockerfile @@ -9,7 +9,7 @@ FROM openjdk:8-jre-alpine MAINTAINER ameizi -ENV VERSION 0.10.0 +ENV VERSION 0.10.1 RUN echo "http://mirrors.aliyun.com/alpine/v3.6/main" > /etc/apk/repositories \ && echo "http://mirrors.aliyun.com/alpine/v3.6/community" >> /etc/apk/repositories \ diff --git a/pom.xml b/pom.xml index 9dace8eef5de5d1eab972bc2cc3c980b43a9b9c5..47198b5081185d292ea666f4e5f596bb162a720a 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.ctrip.framework.apollo apollo - 0.10.0 + 0.10.1 Apollo pom Ctrip Configuration Center