From 4038c23fe5276c52c52a44fb4e6fdb2d6c2ba69e Mon Sep 17 00:00:00 2001 From: SkyeBeFreeman <928016560@qq.com> Date: Fri, 15 Apr 2022 17:03:37 +0800 Subject: [PATCH] feat:optimize code style. --- CHANGELOG.md | 2 +- .../config/MetadataTransferAutoConfiguration.java | 3 ++- .../DecodeTransferMetadataReactiveFilterTest.java | 3 +-- .../DecodeTransferMetadataServletFilterTest.java | 3 +-- .../MetadataTransferAutoConfigurationTest.java | 4 ++-- .../polaris/registry/PolarisServiceRegistry.java | 7 ++++--- .../cloud/polaris/ribbon/PolarisServerList.java | 3 ++- .../ratelimit/filter/QuotaCheckReactiveFilter.java | 11 +++++++---- .../ratelimit/filter/QuotaCheckServletFilter.java | 10 +++++++--- .../PolarisRateLimiterLabelReactiveResolver.java | 1 - .../spi/PolarisRateLimiterLabelServletResolver.java | 1 - .../cloud/common/metadata/MetadataContext.java | 13 ++++++++----- .../src/main/resources/bootstrap.yml | 4 ++-- .../example/service/callee/CustomLabelResolver.java | 5 +++-- .../router/example/RouterCalleeApplication1.java | 4 +++- .../router/example/RouterCalleeController.java | 1 + .../router/example/RouterCalleeApplication2.java | 2 ++ .../router/example/RouterCallerApplication.java | 3 ++- .../polaris/context/PolarisContextProperties.java | 1 + 19 files changed, 49 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index edcbab006..f3f17fd8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,10 @@ --- - [Bugfix: fix router bug and add router example](https://github.com/Tencent/spring-cloud-tencent/pull/89) -- [feat:add switch of polaris, discovery and register.](https://github.com/Tencent/spring-cloud-tencent/pull/122) - [feat:add custom label resolver spi for rate limit](https://github.com/Tencent/spring-cloud-tencent/pull/105) - [feat:fix discovery weight param not set to register request bug](https://github.com/Tencent/spring-cloud-tencent/pull/102) - [Bugfix: fix causing cpu 100% when set ScheduledThreadPoolExecutor corePoolSize=0](https://github.com/Tencent/spring-cloud-tencent/pull/98) - [Bugfix: fix circuitbreaker http code greater than 400 as fail response bug](https://github.com/Tencent/spring-cloud-tencent/pull/116) - [Feat: optimize router dependency](https://github.com/Tencent/spring-cloud-tencent/pull/110) - [Refactor: refactor transfer metadata](https://github.com/Tencent/spring-cloud-tencent/pull/111) +- [feat:add switch of polaris, discovery and register.](https://github.com/Tencent/spring-cloud-tencent/pull/122) diff --git a/spring-cloud-starter-tencent-metadata-transfer/src/main/java/com/tencent/cloud/metadata/config/MetadataTransferAutoConfiguration.java b/spring-cloud-starter-tencent-metadata-transfer/src/main/java/com/tencent/cloud/metadata/config/MetadataTransferAutoConfiguration.java index 51740c1cf..589875875 100644 --- a/spring-cloud-starter-tencent-metadata-transfer/src/main/java/com/tencent/cloud/metadata/config/MetadataTransferAutoConfiguration.java +++ b/spring-cloud-starter-tencent-metadata-transfer/src/main/java/com/tencent/cloud/metadata/config/MetadataTransferAutoConfiguration.java @@ -209,7 +209,8 @@ public class MetadataTransferAutoConfiguration { // Avoid setting interceptor repeatedly. if (null != interceptors && !interceptors .contains(encodeTransferMedataRestTemplateInterceptor)) { - interceptors.add(this.encodeTransferMedataRestTemplateInterceptor); + interceptors + .add(this.encodeTransferMedataRestTemplateInterceptor); restTemplate.setInterceptors(interceptors); } } diff --git a/spring-cloud-starter-tencent-metadata-transfer/src/test/java/com/tencent/cloud/metadata/DecodeTransferMetadataReactiveFilterTest.java b/spring-cloud-starter-tencent-metadata-transfer/src/test/java/com/tencent/cloud/metadata/DecodeTransferMetadataReactiveFilterTest.java index 418716e87..6f6b9cc20 100644 --- a/spring-cloud-starter-tencent-metadata-transfer/src/test/java/com/tencent/cloud/metadata/DecodeTransferMetadataReactiveFilterTest.java +++ b/spring-cloud-starter-tencent-metadata-transfer/src/test/java/com/tencent/cloud/metadata/DecodeTransferMetadataReactiveFilterTest.java @@ -38,13 +38,12 @@ import org.springframework.web.server.WebFilterChain; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.MOCK; /** - * * @author Haotian Zhang */ @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = MOCK, classes = DecodeTransferMetadataServletFilterTest.TestApplication.class, - properties = {"spring.config.location = classpath:application-test.yml"}) + properties = { "spring.config.location = classpath:application-test.yml" }) public class DecodeTransferMetadataReactiveFilterTest { @Autowired diff --git a/spring-cloud-starter-tencent-metadata-transfer/src/test/java/com/tencent/cloud/metadata/DecodeTransferMetadataServletFilterTest.java b/spring-cloud-starter-tencent-metadata-transfer/src/test/java/com/tencent/cloud/metadata/DecodeTransferMetadataServletFilterTest.java index 42b5598eb..41cc512b8 100644 --- a/spring-cloud-starter-tencent-metadata-transfer/src/test/java/com/tencent/cloud/metadata/DecodeTransferMetadataServletFilterTest.java +++ b/spring-cloud-starter-tencent-metadata-transfer/src/test/java/com/tencent/cloud/metadata/DecodeTransferMetadataServletFilterTest.java @@ -40,13 +40,12 @@ import org.springframework.test.context.junit4.SpringRunner; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; /** - * * @author Haotian Zhang */ @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT, classes = DecodeTransferMetadataServletFilterTest.TestApplication.class, - properties = {"spring.config.location = classpath:application-test.yml"}) + properties = { "spring.config.location = classpath:application-test.yml" }) public class DecodeTransferMetadataServletFilterTest { @Autowired diff --git a/spring-cloud-starter-tencent-metadata-transfer/src/test/java/com/tencent/cloud/metadata/config/MetadataTransferAutoConfigurationTest.java b/spring-cloud-starter-tencent-metadata-transfer/src/test/java/com/tencent/cloud/metadata/config/MetadataTransferAutoConfigurationTest.java index a60eb5130..a3d924158 100644 --- a/spring-cloud-starter-tencent-metadata-transfer/src/test/java/com/tencent/cloud/metadata/config/MetadataTransferAutoConfigurationTest.java +++ b/spring-cloud-starter-tencent-metadata-transfer/src/test/java/com/tencent/cloud/metadata/config/MetadataTransferAutoConfigurationTest.java @@ -52,8 +52,8 @@ public class MetadataTransferAutoConfigurationTest { .hasSingleBean(EncodeTransferMedataFeignInterceptor.class); Assertions.assertThat(context).hasSingleBean( MetadataTransferAutoConfiguration.MetadataTransferRestTemplateConfig.class); - Assertions.assertThat(context) - .hasSingleBean(EncodeTransferMedataRestTemplateInterceptor.class); + Assertions.assertThat(context).hasSingleBean( + EncodeTransferMedataRestTemplateInterceptor.class); Assertions.assertThat(context).hasSingleBean( MetadataTransferAutoConfiguration.MetadataTransferRestTemplateConfig.EncodeTransferMetadataRestTemplatePostProcessor.class); Assertions.assertThat(context).hasSingleBean( diff --git a/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/registry/PolarisServiceRegistry.java b/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/registry/PolarisServiceRegistry.java index 24b2a0a4a..83f8967f0 100644 --- a/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/registry/PolarisServiceRegistry.java +++ b/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/registry/PolarisServiceRegistry.java @@ -73,9 +73,10 @@ public class PolarisServiceRegistry implements ServiceRegistry { this.metadataLocalProperties = metadataLocalProperties; if (polarisDiscoveryProperties.isHeartbeatEnabled()) { - this.heartbeatExecutor = Executors - .newSingleThreadScheduledExecutor(new NamedThreadFactory("spring-cloud-heartbeat")); - } else { + this.heartbeatExecutor = Executors.newSingleThreadScheduledExecutor( + new NamedThreadFactory("spring-cloud-heartbeat")); + } + else { this.heartbeatExecutor = null; } } diff --git a/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/ribbon/PolarisServerList.java b/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/ribbon/PolarisServerList.java index 15d72323f..866cdcf1d 100644 --- a/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/ribbon/PolarisServerList.java +++ b/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/ribbon/PolarisServerList.java @@ -56,7 +56,8 @@ public class PolarisServerList extends AbstractServerList { } private List getServers() { - InstancesResponse allInstances = polarisDiscoveryHandler.getFilteredInstances(serviceId); + InstancesResponse allInstances = polarisDiscoveryHandler + .getFilteredInstances(serviceId); ServiceInstances serviceInstances = allInstances.toServiceInstances(); List polarisServers = new ArrayList<>(); for (Instance instance : serviceInstances.getInstances()) { diff --git a/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/filter/QuotaCheckReactiveFilter.java b/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/filter/QuotaCheckReactiveFilter.java index 833f75af0..0db616f7f 100644 --- a/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/filter/QuotaCheckReactiveFilter.java +++ b/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/filter/QuotaCheckReactiveFilter.java @@ -91,8 +91,10 @@ public class QuotaCheckReactiveFilter implements WebFilter, Ordered { if (!CollectionUtils.isEmpty(customLabels)) { labels.putAll(customLabels); } - } catch (Throwable e) { - LOG.error("resolve custom label failed. resolver = {}", labelResolver.getClass().getName(), e); + } + catch (Throwable e) { + LOG.error("resolve custom label failed. resolver = {}", + labelResolver.getClass().getName(), e); } } @@ -104,8 +106,9 @@ public class QuotaCheckReactiveFilter implements WebFilter, Ordered { ServerHttpResponse response = exchange.getResponse(); response.setStatusCode(HttpStatus.TOO_MANY_REQUESTS); response.getHeaders().setContentType(MediaType.APPLICATION_JSON); - DataBuffer dataBuffer = response.bufferFactory().allocateBuffer().write( - RateLimitConstant.QUOTA_LIMITED_INFO.getBytes(StandardCharsets.UTF_8)); + DataBuffer dataBuffer = response.bufferFactory().allocateBuffer() + .write(RateLimitConstant.QUOTA_LIMITED_INFO + .getBytes(StandardCharsets.UTF_8)); return response.writeWith(Mono.just(dataBuffer)); } } diff --git a/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/filter/QuotaCheckServletFilter.java b/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/filter/QuotaCheckServletFilter.java index 7b36652a4..85706d944 100644 --- a/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/filter/QuotaCheckServletFilter.java +++ b/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/filter/QuotaCheckServletFilter.java @@ -57,9 +57,11 @@ public class QuotaCheckServletFilter extends OncePerRequestFilter { .getLogger(QuotaCheckServletFilter.class); private final LimitAPI limitAPI; + private final PolarisRateLimiterLabelServletResolver labelResolver; - public QuotaCheckServletFilter(LimitAPI limitAPI, PolarisRateLimiterLabelServletResolver labelResolver) { + public QuotaCheckServletFilter(LimitAPI limitAPI, + PolarisRateLimiterLabelServletResolver labelResolver) { this.limitAPI = limitAPI; this.labelResolver = labelResolver; } @@ -87,8 +89,10 @@ public class QuotaCheckServletFilter extends OncePerRequestFilter { if (!CollectionUtils.isEmpty(customLabels)) { labels.putAll(customLabels); } - } catch (Throwable e) { - LOG.error("resolve custom label failed. resolver = {}", labelResolver.getClass().getName(), e); + } + catch (Throwable e) { + LOG.error("resolve custom label failed. resolver = {}", + labelResolver.getClass().getName(), e); } } diff --git a/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/spi/PolarisRateLimiterLabelReactiveResolver.java b/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/spi/PolarisRateLimiterLabelReactiveResolver.java index 790c7c0d5..4ebcc1921 100644 --- a/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/spi/PolarisRateLimiterLabelReactiveResolver.java +++ b/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/spi/PolarisRateLimiterLabelReactiveResolver.java @@ -31,7 +31,6 @@ public interface PolarisRateLimiterLabelReactiveResolver { /** * Resolve custom label from request. - * * @param exchange the http request * @return resolved labels */ diff --git a/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/spi/PolarisRateLimiterLabelServletResolver.java b/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/spi/PolarisRateLimiterLabelServletResolver.java index 8fe859092..253b67b5c 100644 --- a/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/spi/PolarisRateLimiterLabelServletResolver.java +++ b/spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/spi/PolarisRateLimiterLabelServletResolver.java @@ -31,7 +31,6 @@ public interface PolarisRateLimiterLabelServletResolver { /** * Resolve custom label from request. - * * @param request the http request * @return resolved labels */ diff --git a/spring-cloud-tencent-commons/src/main/java/com/tencent/cloud/common/metadata/MetadataContext.java b/spring-cloud-tencent-commons/src/main/java/com/tencent/cloud/common/metadata/MetadataContext.java index 573574a78..6f06e811b 100644 --- a/spring-cloud-tencent-commons/src/main/java/com/tencent/cloud/common/metadata/MetadataContext.java +++ b/spring-cloud-tencent-commons/src/main/java/com/tencent/cloud/common/metadata/MetadataContext.java @@ -55,17 +55,20 @@ public class MetadataContext { private final Map systemMetadata; static { - String namespace = ApplicationContextAwareUtils.getProperties("spring.cloud.polaris.namespace"); + String namespace = ApplicationContextAwareUtils + .getProperties("spring.cloud.polaris.namespace"); if (StringUtils.isEmpty(namespace)) { - namespace = ApplicationContextAwareUtils.getProperties("spring.cloud.polaris.discovery.namespace", "default"); + namespace = ApplicationContextAwareUtils + .getProperties("spring.cloud.polaris.discovery.namespace", "default"); } LOCAL_NAMESPACE = namespace; - String serviceName = ApplicationContextAwareUtils.getProperties("spring.cloud.polaris.service"); + String serviceName = ApplicationContextAwareUtils + .getProperties("spring.cloud.polaris.service"); if (StringUtils.isEmpty(serviceName)) { serviceName = ApplicationContextAwareUtils.getProperties( - "spring.cloud.polaris.discovery.service", - ApplicationContextAwareUtils.getProperties("spring.application.name", null)); + "spring.cloud.polaris.discovery.service", ApplicationContextAwareUtils + .getProperties("spring.application.name", null)); } LOCAL_SERVICE = serviceName; } diff --git a/spring-cloud-tencent-examples/polaris-discovery-example/discovery-callee-service/src/main/resources/bootstrap.yml b/spring-cloud-tencent-examples/polaris-discovery-example/discovery-callee-service/src/main/resources/bootstrap.yml index e240ebb23..868201dde 100644 --- a/spring-cloud-tencent-examples/polaris-discovery-example/discovery-callee-service/src/main/resources/bootstrap.yml +++ b/spring-cloud-tencent-examples/polaris-discovery-example/discovery-callee-service/src/main/resources/bootstrap.yml @@ -16,8 +16,8 @@ spring: # host: 127.0.0.1 # enabled: true # discovery: -# enabled: false -# register: false +# enabled: true +# register: true # instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port} # service-name: ${spring.application.name} # ip-address: localhost diff --git a/spring-cloud-tencent-examples/polaris-ratelimit-example/ratelimit-callee-service/src/main/java/com/tencent/cloud/ratelimit/example/service/callee/CustomLabelResolver.java b/spring-cloud-tencent-examples/polaris-ratelimit-example/ratelimit-callee-service/src/main/java/com/tencent/cloud/ratelimit/example/service/callee/CustomLabelResolver.java index 837de09c5..f441f4d2b 100644 --- a/spring-cloud-tencent-examples/polaris-ratelimit-example/ratelimit-callee-service/src/main/java/com/tencent/cloud/ratelimit/example/service/callee/CustomLabelResolver.java +++ b/spring-cloud-tencent-examples/polaris-ratelimit-example/ratelimit-callee-service/src/main/java/com/tencent/cloud/ratelimit/example/service/callee/CustomLabelResolver.java @@ -30,18 +30,19 @@ import org.springframework.stereotype.Component; /** * resolver custom label from request. * - *@author lepdou 2022-03-31 + * @author lepdou 2022-03-31 */ @Component public class CustomLabelResolver implements PolarisRateLimiterLabelServletResolver { @Override public Map resolve(HttpServletRequest request) { - //rate limit by some request params. such as query params, headers .. + // rate limit by some request params. such as query params, headers .. Map labels = new HashMap<>(); labels.put("user", "zhangsan"); return labels; } + } diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeApplication1.java b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeApplication1.java index 4692d6847..6b481e472 100644 --- a/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeApplication1.java +++ b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeApplication1.java @@ -23,7 +23,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; /** * Router callee application. - *@author lepdou 2022-04-06 + * + * @author lepdou 2022-04-06 */ @SpringBootApplication public class RouterCalleeApplication1 { @@ -31,4 +32,5 @@ public class RouterCalleeApplication1 { public static void main(String[] args) { SpringApplication.run(RouterCalleeApplication1.class, args); } + } diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeController.java b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeController.java index 4a9f19394..f02f1887d 100644 --- a/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeController.java +++ b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeController.java @@ -49,4 +49,5 @@ public class RouterCalleeController { LOG.info("Discovery Service Callee [{}] is called.", port); return String.format("Discovery Service Callee [%s] is called.", port); } + } diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeApplication2.java b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeApplication2.java index 5f0bc6300..9664f46d3 100644 --- a/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeApplication2.java +++ b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeApplication2.java @@ -23,6 +23,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; /** * Router callee application. + * * @author lepdou 2022-04-06 */ @SpringBootApplication @@ -31,4 +32,5 @@ public class RouterCalleeApplication2 { public static void main(String[] args) { SpringApplication.run(RouterCalleeApplication2.class, args); } + } diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/java/com/tencent/cloud/polaris/router/example/RouterCallerApplication.java b/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/java/com/tencent/cloud/polaris/router/example/RouterCallerApplication.java index f7b114a41..824a1226f 100644 --- a/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/java/com/tencent/cloud/polaris/router/example/RouterCallerApplication.java +++ b/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/java/com/tencent/cloud/polaris/router/example/RouterCallerApplication.java @@ -29,7 +29,7 @@ import org.springframework.web.client.RestTemplate; /** * Router caller application. * - *@author lepdou 2022-04-06 + * @author lepdou 2022-04-06 */ @SpringBootApplication @EnableDiscoveryClient @@ -45,4 +45,5 @@ public class RouterCallerApplication { public RestTemplate restTemplate() { return new RestTemplate(); } + } diff --git a/spring-cloud-tencent-polaris-context/src/main/java/com/tencent/cloud/polaris/context/PolarisContextProperties.java b/spring-cloud-tencent-polaris-context/src/main/java/com/tencent/cloud/polaris/context/PolarisContextProperties.java index 7b91de396..9c69a4129 100644 --- a/spring-cloud-tencent-polaris-context/src/main/java/com/tencent/cloud/polaris/context/PolarisContextProperties.java +++ b/spring-cloud-tencent-polaris-context/src/main/java/com/tencent/cloud/polaris/context/PolarisContextProperties.java @@ -137,4 +137,5 @@ public class PolarisContextProperties { void setService(String service) { this.service = service; } + }