mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
format code with maven plugins
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -16,6 +16,11 @@
|
||||
|
||||
package com.alibaba.alicloud.ans;
|
||||
|
||||
import com.alibaba.alicloud.ans.registry.AnsAutoServiceRegistration;
|
||||
import com.alibaba.alicloud.ans.registry.AnsRegistration;
|
||||
import com.alibaba.alicloud.ans.registry.AnsServiceRegistry;
|
||||
import com.alibaba.alicloud.context.ans.AnsProperties;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
@@ -28,18 +33,15 @@ import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.alibaba.alicloud.ans.registry.AnsAutoServiceRegistration;
|
||||
import com.alibaba.alicloud.ans.registry.AnsRegistration;
|
||||
import com.alibaba.alicloud.ans.registry.AnsServiceRegistry;
|
||||
import com.alibaba.alicloud.context.ans.AnsProperties;
|
||||
|
||||
/**
|
||||
* @author xiaolongzuo
|
||||
*/
|
||||
@Configuration
|
||||
@EnableConfigurationProperties
|
||||
@ConditionalOnClass(name = "org.springframework.boot.web.context.WebServerInitializedEvent")
|
||||
@ConditionalOnProperty(value = "spring.cloud.service-registry.auto-registration.enabled", matchIfMissing = true)
|
||||
@ConditionalOnClass(
|
||||
name = "org.springframework.boot.web.context.WebServerInitializedEvent")
|
||||
@ConditionalOnProperty(value = "spring.cloud.service-registry.auto-registration.enabled",
|
||||
matchIfMissing = true)
|
||||
@ConditionalOnAnsEnabled
|
||||
@AutoConfigureAfter({ AutoServiceRegistrationConfiguration.class,
|
||||
AutoServiceRegistrationAutoConfiguration.class })
|
||||
@@ -52,7 +54,9 @@ public class AnsAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(AutoServiceRegistrationProperties.class)
|
||||
@ConditionalOnProperty(value = "spring.cloud.service-registry.auto-registration.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(
|
||||
value = "spring.cloud.service-registry.auto-registration.enabled",
|
||||
matchIfMissing = true)
|
||||
public AnsRegistration ansRegistration(AnsProperties ansProperties,
|
||||
ApplicationContext applicationContext) {
|
||||
return new AnsRegistration(ansProperties, applicationContext);
|
||||
@@ -60,7 +64,9 @@ public class AnsAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(AutoServiceRegistrationProperties.class)
|
||||
@ConditionalOnProperty(value = "spring.cloud.service-registry.auto-registration.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(
|
||||
value = "spring.cloud.service-registry.auto-registration.enabled",
|
||||
matchIfMissing = true)
|
||||
public AnsAutoServiceRegistration ansAutoServiceRegistration(
|
||||
AnsServiceRegistry registry,
|
||||
AutoServiceRegistrationProperties autoServiceRegistrationProperties,
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -23,18 +23,21 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||
|
||||
import com.alibaba.ans.core.NamingService;
|
||||
import com.alibaba.ans.shaded.com.taobao.vipserver.client.core.Host;
|
||||
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||
|
||||
/**
|
||||
* @author xiaolongzuo
|
||||
* @author pbting
|
||||
*/
|
||||
public class AnsDiscoveryClient implements DiscoveryClient {
|
||||
|
||||
/**
|
||||
* Description of Ans Discovery.
|
||||
*/
|
||||
public static final String DESCRIPTION = "Spring Cloud ANS Discovery Client";
|
||||
|
||||
@Override
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -30,4 +30,5 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
||||
@ConditionalOnProperty(value = "spring.cloud.ans.enabled", matchIfMissing = true)
|
||||
public @interface ConditionalOnAnsEnabled {
|
||||
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -21,14 +21,14 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
|
||||
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
|
||||
|
||||
import com.alibaba.alicloud.context.ans.AnsProperties;
|
||||
import com.alibaba.ans.core.NamingService;
|
||||
import com.alibaba.ans.shaded.com.taobao.vipserver.client.core.Host;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
|
||||
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
|
||||
|
||||
/**
|
||||
* @author xiaolongzuo
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
package com.alibaba.alicloud.ans.endpoint;
|
||||
|
||||
import com.alibaba.alicloud.context.ans.AnsProperties;
|
||||
|
||||
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
import com.alibaba.alicloud.context.ans.AnsProperties;
|
||||
|
||||
/**
|
||||
* @author xiaolongzuo
|
||||
*/
|
||||
@@ -34,4 +34,5 @@ public class AnsEndpointAutoConfiguration {
|
||||
public AnsEndpoint ansEndpoint(AnsProperties ansProperties) {
|
||||
return new AnsEndpoint(ansProperties);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -18,6 +18,7 @@ package com.alibaba.alicloud.ans.registry;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration;
|
||||
import org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationProperties;
|
||||
import org.springframework.cloud.client.serviceregistry.ServiceRegistry;
|
||||
@@ -30,6 +31,7 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class AnsAutoServiceRegistration
|
||||
extends AbstractAutoServiceRegistration<AnsRegistration> {
|
||||
|
||||
private static final Logger log = LoggerFactory
|
||||
.getLogger(AnsAutoServiceRegistration.class);
|
||||
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -21,6 +21,8 @@ import java.util.Map;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import com.alibaba.alicloud.context.ans.AnsProperties;
|
||||
|
||||
import org.springframework.cloud.client.DefaultServiceInstance;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.cloud.client.discovery.ManagementServerPortUtils;
|
||||
@@ -29,8 +31,6 @@ import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.alibaba.alicloud.context.ans.AnsProperties;
|
||||
|
||||
/**
|
||||
* @author xiaolongzuo
|
||||
*/
|
||||
@@ -42,6 +42,7 @@ public class AnsRegistration implements Registration, ServiceInstance {
|
||||
static final String MANAGEMENT_ENDPOINT_BASE_PATH = "management.endpoints.web.base-path";
|
||||
|
||||
private AnsProperties ansProperties;
|
||||
|
||||
private ApplicationContext context;
|
||||
|
||||
public AnsRegistration(AnsProperties ansProperties, ApplicationContext context) {
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -20,13 +20,13 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.ans.core.NamingService;
|
||||
import com.alibaba.ans.shaded.com.taobao.vipserver.client.ipms.NodeReactor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.client.serviceregistry.ServiceRegistry;
|
||||
|
||||
import com.alibaba.ans.core.NamingService;
|
||||
import com.alibaba.ans.shaded.com.taobao.vipserver.client.ipms.NodeReactor;
|
||||
import org.springframework.cloud.client.serviceregistry.ServiceRegistry;
|
||||
|
||||
/**
|
||||
* @author xiaolongzuo
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
package com.alibaba.alicloud.ans.ribbon;
|
||||
|
||||
import com.netflix.client.config.IClientConfig;
|
||||
import com.netflix.loadbalancer.ServerList;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.netflix.client.config.IClientConfig;
|
||||
import com.netflix.loadbalancer.ServerList;
|
||||
|
||||
/**
|
||||
* @author xiaolongzuo
|
||||
* @author pbting
|
||||
@@ -37,4 +37,4 @@ public class AnsRibbonClientConfiguration {
|
||||
return serverList;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -20,7 +20,6 @@ import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.ans.shaded.com.taobao.vipserver.client.core.Host;
|
||||
|
||||
import com.netflix.loadbalancer.Server;
|
||||
|
||||
/**
|
||||
@@ -29,7 +28,9 @@ import com.netflix.loadbalancer.Server;
|
||||
public class AnsServer extends Server {
|
||||
|
||||
private final MetaInfo metaInfo;
|
||||
|
||||
private final Host host;
|
||||
|
||||
private final Map<String, String> metadata;
|
||||
|
||||
public AnsServer(final Host host, final String dom) {
|
||||
@@ -78,4 +79,5 @@ public class AnsServer extends Server {
|
||||
return "AnsServer{" + "metaInfo=" + metaInfo + ", host=" + host + ", metadata="
|
||||
+ metadata + '}';
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -21,7 +21,6 @@ import java.util.List;
|
||||
|
||||
import com.alibaba.ans.core.NamingService;
|
||||
import com.alibaba.ans.shaded.com.taobao.vipserver.client.core.Host;
|
||||
|
||||
import com.netflix.client.config.IClientConfig;
|
||||
import com.netflix.loadbalancer.AbstractServerList;
|
||||
|
||||
@@ -76,4 +75,5 @@ public class AnsServerList extends AbstractServerList<AnsServer> {
|
||||
public void initWithNiwsConfig(IClientConfig iClientConfig) {
|
||||
this.dom = iClientConfig.getClientName();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.alibaba.alicloud.ans.ribbon;
|
||||
|
||||
import com.alibaba.alicloud.ans.ConditionalOnAnsEnabled;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
@@ -24,8 +26,6 @@ import org.springframework.cloud.netflix.ribbon.RibbonClients;
|
||||
import org.springframework.cloud.netflix.ribbon.SpringClientFactory;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.alibaba.alicloud.ans.ConditionalOnAnsEnabled;
|
||||
|
||||
/**
|
||||
* @author xiaolongzuo
|
||||
*/
|
||||
@@ -37,4 +37,5 @@ import com.alibaba.alicloud.ans.ConditionalOnAnsEnabled;
|
||||
@AutoConfigureAfter(RibbonAutoConfiguration.class)
|
||||
@RibbonClients(defaultConfiguration = AnsRibbonClientConfiguration.class)
|
||||
public class RibbonAnsAutoConfiguration {
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user