Skip to content

Commit

Permalink
optimize: compatible with integration.http and integration.http.Jakar…
Browse files Browse the repository at this point in the history
…ta (#6327)
  • Loading branch information
slievrly committed Feb 15, 2024
1 parent 3e36de2 commit 4006df1
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6301](https://github.com/apache/incubator-seata/pull/6301)] upgrade console frontend dependencies and supported nodejs versions
- [[#6301](https://github.com/apache/incubator-seata/pull/6312)] add saga related io.seata compatible api
- [[#6313](https://github.com/apache/incubator-seata/pull/6313)] console display the version number
- [[#6327](https://github.com/apache/incubator-seata/pull/6327)] compatible with integration.http and integration.http.Jakarta
- [[#6328](https://github.com/apache/incubator-seata/pull/6328)] compatible with integration.grpc
- [[#6330](https://github.com/apache/incubator-seata/pull/6330)] remove mariadb API
- [[#6329](https://github.com/apache/incubator-seata/pull/6312)] add saga subcomponent-level io.seata compatible api
Expand Down
2 changes: 1 addition & 1 deletion changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@
- [[#6301](https://github.com/apache/incubator-seata/pull/6301)] 升级console前端依赖及支持的nodejs版本
- [[#6301](https://github.com/apache/incubator-seata/pull/6312)] 添加saga相关的io.seata兼容性API
- [[#6313](https://github.com/apache/incubator-seata/pull/6313)] console展示版本号
- [[#6327](https://github.com/apache/incubator-seata/pull/6327)] 兼容 integration.http 和 integration.http.Jakarta API
- [[#6328](https://github.com/apache/incubator-seata/pull/6328)] 兼容 integration.grpc API
- [[#6330](https://github.com/apache/incubator-seata/pull/6330)] 去除 mariadb API
- [[#6329](https://github.com/apache/incubator-seata/pull/6312)] 添加saga子组件的io.seata兼容性API
- [[#6254](https://github.com/apache/incubator-seata/pull/6254)] 优化Hessian 序列化
- [[#6343](https://github.com/apache/incubator-seata/pull/6343)] 兼容tm 模块和rm-datasource模块



### security:
- [[#6069](https://github.com/apache/incubator-seata/pull/6069)] 升级Guava依赖版本,修复安全漏洞
- [[#6144](https://github.com/apache/incubator-seata/pull/6144)] 升级Nacos依赖版本至1.4.6
Expand Down
21 changes: 21 additions & 0 deletions compatible/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,27 @@
<version>2.1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-http</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-http-jakarta</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.3.20</version>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-grpc</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.seata.integration.http;

import java.util.Map;

import org.apache.http.HttpResponse;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;

public class DefaultHttpExecutor {

private static final org.apache.seata.integration.http.DefaultHttpExecutor INSTANCE
= org.apache.seata.integration.http.DefaultHttpExecutor.getInstance();

private final org.apache.seata.integration.http.DefaultHttpExecutor targetDefaultHttpExecutor;

private DefaultHttpExecutor(final org.apache.seata.integration.http.DefaultHttpExecutor innerInstance) {
this.targetDefaultHttpExecutor = innerInstance;
}

public static DefaultHttpExecutor getInstance() {
return new DefaultHttpExecutor(INSTANCE);
}

public <T> void buildClientEntity(CloseableHttpClient httpClient, T paramObject) {
this.targetDefaultHttpExecutor.buildClientEntity(httpClient, paramObject);
}

public <T> void buildGetHeaders(Map<String, String> headers, T paramObject) {
this.targetDefaultHttpExecutor.buildGetHeaders(headers, paramObject);
}

public String initGetUrl(String host, String path, Map<String, String> querys) {
return this.targetDefaultHttpExecutor.initGetUrl(host, path, querys);
}

public <T> void buildPostHeaders(Map<String, String> headers, T t) {
this.targetDefaultHttpExecutor.buildPostHeaders(headers, t);
}

public <T> StringEntity buildEntity(StringEntity entity, T t) {
return this.targetDefaultHttpExecutor.buildEntity(entity, t);
}

public <K> K convertResult(HttpResponse response, Class<K> clazz) {
return this.targetDefaultHttpExecutor.convertResult(response, clazz);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.seata.integration.http;

public class JakartaSeataWebMvcConfigurer extends org.apache.seata.integration.http.JakartaSeataWebMvcConfigurer{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.seata.integration.http;

public class JakartaTransactionPropagationInterceptor extends org.apache.seata.integration.http.JakartaTransactionPropagationInterceptor{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.seata.integration.http;

public class SeataWebMvcConfigurer extends org.apache.seata.integration.http.SeataWebMvcConfigurer {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.seata.integration.http;

public class TransactionPropagationInterceptor
extends org.apache.seata.integration.http.TransactionPropagationInterceptor {

}

0 comments on commit 4006df1

Please sign in to comment.