Skip to content

Commit

Permalink
add comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunrui1225 committed Dec 29, 2023
1 parent 3055c18 commit 076a8fc
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ public static <T> T createProxy(T target) {
return createProxy(target, target.getClass().getName());
}

/**
* The API for generating proxy for target. It can be used by spring aop, or
* provide user to generate proxy manually.
* <p>
* At TM side, It can be used for the target bean with @GlobalTransactional or @GlobalLock to generate proxy which start global transaction.
* At RM side, if you use TCC mode, It can be for target bean with @TwoPhaseBusinessAction to generate proxy which register branch source
* and branch transaction. If you want to use this API to generate proxy manual like dubbo, you must make sure the target bean is the
* business bean with @GlobalTransactional annotation. If you pass the ServiceBean(com.alibaba.dubbo.config.spring.ServiceBean) or
* ReferenceBean(com.alibaba.dubbo.config.spring.ReferenceBean), it will don't work.
*
* @param target the business bean
* @param beanName the business bean name
* @return the proxy bean
* @param <T> the generics class
*/
public static <T> T createProxy(T target, String beanName) {
try {
synchronized (PROXYED_SET) {
Expand Down

0 comments on commit 076a8fc

Please sign in to comment.