Skip to content

Commit 3f86ccd

Browse files
authored
doc: improve TM module Javadoc (#7462)
1 parent 800a69c commit 3f86ccd

File tree

10 files changed

+752
-87
lines changed

10 files changed

+752
-87
lines changed

changes/en-us/2.x.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Add changes here for all PR submitted to the 2.x branch.
7878

7979
### doc:
8080

81+
- [[#7462](https://github.com/seata/seata/pull/7462)] improve TM module Javadoc with comprehensive English documentation
8182
- [[#7531](https://github.com/seata/seata/pull/7531)] Optimize the Readme and change documents
8283
- [[#7569](https://github.com/seata/seata/pull/7569)] Add hyperlink to CONTRIBUTING.md in pull request template
8384
- [[#7605](https://github.com/apache/incubator-seata/pull/7605)] Add the type of registry as seata in application.yml

changes/zh-cn/2.x.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979

8080
### doc:
8181

82+
- [[#7462](https://github.com/seata/seata/pull/7462)] 完善 TM 模块的 Javadoc,补充全面的英文文档说明。
8283
- [[#7531](https://github.com/seata/seata/pull/7531)] 优化 Readme 和 change 文档
8384
- [[#7569](https://github.com/seata/seata/pull/7569)] 在拉取请求模板中添加 CONTRIBUTING.md 超链接
8485
- [[#7605](https://github.com/apache/incubator-seata/pull/7605)] 在application.yml中增加了seata作为注册中心的注释

tm/src/main/java/org/apache/seata/tm/DefaultTransactionManager.java

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,45 @@
3939
import java.util.concurrent.TimeoutException;
4040

4141
/**
42-
* The type Default transaction manager.
42+
* Default implementation of Transaction Manager (TM) in Seata distributed transaction system.
4343
*
44+
* <p>Acts as the primary client-side component for managing global transactions.
45+
* Forwards transaction management operations to Transaction Coordinator (TC) server
46+
* through network communication.</p>
47+
*
48+
* <p><b>Core Operations:</b></p>
49+
* <ul>
50+
* <li><b>Begin</b>: Request new global transaction and receive XID</li>
51+
* <li><b>Commit</b>: Initiate two-phase commit protocol</li>
52+
* <li><b>Rollback</b>: Request global transaction rollback</li>
53+
* <li><b>Status Query</b>: Retrieve current transaction status</li>
54+
* <li><b>Status Report</b>: Report transaction status changes</li>
55+
* </ul>
56+
*
57+
* <p><b>Communication:</b> Uses Netty-based TCP communication with configurable
58+
* serialization, connection pooling, and automatic failover to available TC servers.</p>
59+
*
60+
* <p><b>Usage Example:</b></p>
61+
* <pre>{@code
62+
* TransactionManager tm = new DefaultTransactionManager();
63+
* try {
64+
* String xid = tm.begin("app-id", "service-group", "order-create", 30000);
65+
* // Execute business logic...
66+
* GlobalStatus status = tm.commit(xid);
67+
* } catch (TransactionException e) {
68+
* tm.rollback(xid);
69+
* throw e;
70+
* }
71+
* }</pre>
72+
*
73+
* <p>Thread-safe and typically used indirectly through {@link org.apache.seata.tm.api.DefaultGlobalTransaction}
74+
* or {@link org.apache.seata.tm.api.TransactionalTemplate}.</p>
75+
*
76+
* @author Seata Team
77+
* @see TransactionManager
78+
* @see TmNettyRemotingClient
79+
* @see org.apache.seata.tm.api.DefaultGlobalTransaction
80+
* @since 1.0.0
4481
*/
4582
public class DefaultTransactionManager implements TransactionManager {
4683

0 commit comments

Comments
 (0)