mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Polish alibaba/spring-cloud-alibaba#1758 : [CodeBase] Sync the source code from greenwich to finichley
This commit is contained in:
@@ -36,11 +36,9 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class SeataFeignClient implements Client {
|
||||
|
||||
private final Client delegate;
|
||||
|
||||
private final BeanFactory beanFactory;
|
||||
|
||||
private static final int MAP_SIZE = 16;
|
||||
private final Client delegate;
|
||||
private final BeanFactory beanFactory;
|
||||
|
||||
SeataFeignClient(BeanFactory beanFactory) {
|
||||
this.beanFactory = beanFactory;
|
||||
|
@@ -65,19 +65,19 @@ public class SeataFeignClientAutoConfiguration {
|
||||
protected static class FeignBeanPostProcessorConfiguration {
|
||||
|
||||
@Bean
|
||||
SeataBeanPostProcessor seataBeanPostProcessor(
|
||||
SeataBeanPostProcessor seataBeanPostProcessor(
|
||||
SeataFeignObjectWrapper seataFeignObjectWrapper) {
|
||||
return new SeataBeanPostProcessor(seataFeignObjectWrapper);
|
||||
}
|
||||
|
||||
@Bean
|
||||
SeataContextBeanPostProcessor seataContextBeanPostProcessor(
|
||||
SeataContextBeanPostProcessor seataContextBeanPostProcessor(
|
||||
BeanFactory beanFactory) {
|
||||
return new SeataContextBeanPostProcessor(beanFactory);
|
||||
}
|
||||
|
||||
@Bean
|
||||
SeataFeignObjectWrapper seataFeignObjectWrapper(BeanFactory beanFactory) {
|
||||
SeataFeignObjectWrapper seataFeignObjectWrapper(BeanFactory beanFactory) {
|
||||
return new SeataFeignObjectWrapper(beanFactory);
|
||||
}
|
||||
|
||||
|
@@ -33,9 +33,9 @@ import org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient;
|
||||
public class SeataLoadBalancerFeignClient extends LoadBalancerFeignClient {
|
||||
|
||||
SeataLoadBalancerFeignClient(Client delegate,
|
||||
CachingSpringLoadBalancerFactory lbClientFactory,
|
||||
SpringClientFactory clientFactory,
|
||||
SeataFeignObjectWrapper seataFeignObjectWrapper) {
|
||||
CachingSpringLoadBalancerFactory lbClientFactory,
|
||||
SpringClientFactory clientFactory,
|
||||
SeataFeignObjectWrapper seataFeignObjectWrapper) {
|
||||
super((Client) seataFeignObjectWrapper.wrap(delegate), lbClientFactory,
|
||||
clientFactory);
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
public class SeataHystrixAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
SeataHystrixConcurrencyStrategy seataHystrixConcurrencyStrategy() {
|
||||
SeataHystrixConcurrencyStrategy seataHystrixConcurrencyStrategy() {
|
||||
return new SeataHystrixConcurrencyStrategy();
|
||||
}
|
||||
|
||||
|
@@ -35,17 +35,16 @@ import org.springframework.web.client.RestTemplate;
|
||||
@Configuration
|
||||
public class SeataRestTemplateAutoConfiguration {
|
||||
|
||||
@Autowired(required = false)
|
||||
private Collection<RestTemplate> restTemplates;
|
||||
@Autowired
|
||||
private SeataRestTemplateInterceptor seataRestTemplateInterceptor;
|
||||
|
||||
@Bean
|
||||
public SeataRestTemplateInterceptor seataRestTemplateInterceptor() {
|
||||
return new SeataRestTemplateInterceptor();
|
||||
}
|
||||
|
||||
@Autowired(required = false)
|
||||
private Collection<RestTemplate> restTemplates;
|
||||
|
||||
@Autowired
|
||||
private SeataRestTemplateInterceptor seataRestTemplateInterceptor;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
if (this.restTemplates != null) {
|
||||
|
@@ -34,7 +34,7 @@ public class SeataRestTemplateInterceptor implements ClientHttpRequestIntercepto
|
||||
|
||||
@Override
|
||||
public ClientHttpResponse intercept(HttpRequest httpRequest, byte[] bytes,
|
||||
ClientHttpRequestExecution clientHttpRequestExecution) throws IOException {
|
||||
ClientHttpRequestExecution clientHttpRequestExecution) throws IOException {
|
||||
HttpRequestWrapper requestWrapper = new HttpRequestWrapper(httpRequest);
|
||||
|
||||
String xid = RootContext.getXID();
|
||||
|
@@ -42,7 +42,7 @@ public class SeataHandlerInterceptor implements HandlerInterceptor {
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response,
|
||||
Object handler) {
|
||||
Object handler) {
|
||||
|
||||
String xid = RootContext.getXID();
|
||||
String rpcXid = request.getHeader(RootContext.KEY_XID);
|
||||
@@ -61,7 +61,7 @@ public class SeataHandlerInterceptor implements HandlerInterceptor {
|
||||
|
||||
@Override
|
||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response,
|
||||
Object handler, Exception e) {
|
||||
Object handler, Exception e) {
|
||||
if (StringUtils.isNotBlank(RootContext.getXID())) {
|
||||
String rpcXid = request.getHeader(RootContext.KEY_XID);
|
||||
|
||||
|
Reference in New Issue
Block a user