Skip to content

Commit

Permalink
Resolve review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
leezongjie committed Feb 28, 2024
1 parent ea2b18a commit eefd4bb
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* 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 org.apache.seata.integration.tx.api.interceptor;

/**
* The InvocationHandlerType enum
*/
public enum InvocationHandlerType {

GlobalTransactional, TwoPhaseAnnotation

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.apache.seata.core.model.GlobalLockConfig;
import org.apache.seata.integration.tx.api.annotation.AspectTransactional;
import org.apache.seata.integration.tx.api.event.DegradeCheckEvent;
import org.apache.seata.integration.tx.api.interceptor.InvocationHandlerType;
import org.apache.seata.integration.tx.api.interceptor.InvocationWrapper;
import org.apache.seata.integration.tx.api.interceptor.SeataInterceptorPosition;
import org.apache.seata.integration.tx.api.util.ClassUtils;
Expand Down Expand Up @@ -413,6 +414,6 @@ public SeataInterceptorPosition getPosition() {

@Override
public String type() {
return "GlobalTransactional";
return InvocationHandlerType.GlobalTransactional.name();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@ public ProxyInvocationHandler parserInterfaceToProxy(Object target, String objec

Collections.sort(invocationHandlerList, Comparator.comparingInt(ProxyInvocationHandler::order));

ProxyInvocationHandler result = null;
ProxyInvocationHandler first = null;
ProxyInvocationHandler last = null;
for (ProxyInvocationHandler proxyInvocationHandler : invocationHandlerList) {
if (result == null) {
result = proxyInvocationHandler;
if (first == null) {
first = proxyInvocationHandler;
}
if (last != null) {
last.setNextProxyInvocationHandler(proxyInvocationHandler);
}
last = proxyInvocationHandler;
}

return result;
return first;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.apache.seata.core.model.BranchType;
import org.apache.seata.integration.tx.api.fence.config.CommonFenceConfig;
import org.apache.seata.integration.tx.api.interceptor.ActionInterceptorHandler;
import org.apache.seata.integration.tx.api.interceptor.InvocationHandlerType;
import org.apache.seata.integration.tx.api.interceptor.InvocationWrapper;
import org.apache.seata.integration.tx.api.interceptor.SeataInterceptorPosition;
import org.apache.seata.integration.tx.api.interceptor.TwoPhaseBusinessActionParam;
Expand Down Expand Up @@ -171,6 +172,6 @@ public int order() {

@Override
public String type() {
return "twoPhaseAnnotation";
return InvocationHandlerType.TwoPhaseAnnotation.name();
}
}

0 comments on commit eefd4bb

Please sign in to comment.