-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refactoring-1.6.x' into master-1.6.x
* refactoring-1.6.x: update the tcc transaction dubbo, remove tccJavassist and tccJdk. update the TransactionContextEditor fix sample error. add CompensableTransactionFilter, remove TccJavassist. add dubbo filter # Conflicts: # tcc-transaction-dubbo/src/main/java/org/mengyun/tcctransaction/dubbo/filter/CompensableTransactionFilter.java # tcc-transaction-dubbo/src/main/resources/META-INF/dubbo/org.apache.dubbo.rpc.Filter
- Loading branch information
Showing
50 changed files
with
670 additions
and
1,541 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import React from 'react'; | ||
import {Button, Modal} from 'antd'; | ||
import ReactJson from 'react-json-view'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './index.css'; | ||
import App from './App'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
tcc-transaction-admin-web/src/pages/tcc/domain/DrawerDomainList.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tcc-transaction-api/src/main/java/org/mengyun/tcctransaction/api/EnableTcc.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.mengyun.tcctransaction.api; | ||
|
||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.METHOD}) | ||
public @interface EnableTcc { | ||
} |
16 changes: 16 additions & 0 deletions
16
...on-api/src/main/java/org/mengyun/tcctransaction/api/NullableTransactionContextEditor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.mengyun.tcctransaction.api; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
public class NullableTransactionContextEditor implements TransactionContextEditor { | ||
|
||
@Override | ||
public TransactionContext get(Object target, Method method, Object[] args) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void set(TransactionContext transactionContext, Object target, Method method, Object[] args) { | ||
|
||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
...n-api/src/main/java/org/mengyun/tcctransaction/api/ParameterTransactionContextEditor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package org.mengyun.tcctransaction.api; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
public class ParameterTransactionContextEditor implements TransactionContextEditor { | ||
|
||
public static int getTransactionContextParamPosition(Class<?>[] parameterTypes) { | ||
|
||
int position = -1; | ||
|
||
for (int i = 0; i < parameterTypes.length; i++) { | ||
if (parameterTypes[i].equals(org.mengyun.tcctransaction.api.TransactionContext.class)) { | ||
position = i; | ||
break; | ||
} | ||
} | ||
return position; | ||
} | ||
|
||
public static boolean hasTransactionContextParameter(Class<?>[] parameterTypes) { | ||
return getTransactionContextParamPosition(parameterTypes) >= 0; | ||
} | ||
|
||
public static TransactionContext getTransactionContextFromArgs(Object[] args) { | ||
|
||
TransactionContext transactionContext = null; | ||
|
||
for (Object arg : args) { | ||
if (arg != null && org.mengyun.tcctransaction.api.TransactionContext.class.isAssignableFrom(arg.getClass())) { | ||
|
||
transactionContext = (org.mengyun.tcctransaction.api.TransactionContext) arg; | ||
} | ||
} | ||
|
||
return transactionContext; | ||
} | ||
|
||
@Override | ||
public TransactionContext get(Object target, Method method, Object[] args) { | ||
int position = getTransactionContextParamPosition(method.getParameterTypes()); | ||
|
||
if (position >= 0) { | ||
return (TransactionContext) args[position]; | ||
} else { | ||
throw new RuntimeException("No TransactionContext parameter exist while get TransactionContext with ParameterTransactionContextEditor!"); | ||
} | ||
} | ||
|
||
@Override | ||
public void set(TransactionContext transactionContext, Object target, Method method, Object[] args) { | ||
|
||
int position = getTransactionContextParamPosition(method.getParameterTypes()); | ||
if (position >= 0) { | ||
args[position] = transactionContext; | ||
} else { | ||
throw new RuntimeException("No TransactionContext parameter exist while set TransactionContext with ParameterTransactionContextEditor!"); | ||
} | ||
} | ||
} |
Oops, something went wrong.