slievrly commented on code in PR #6342:
URL: https://github.com/apache/incubator-seata/pull/6342#discussion_r1488181775


##########
compatible/src/main/java/io/seata/integration/tx/api/interceptor/ActionContextUtil.java:
##########
@@ -0,0 +1,140 @@
+/*
+ * 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.tx.api.interceptor;
+
+import io.seata.rm.tcc.api.BusinessActionContextParameter;
+import org.apache.seata.rm.tcc.api.BusinessActionContext;
+import org.apache.seata.rm.tcc.api.ParamType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import java.util.Map;
+
+/**
+ * Extracting TCC Context from Method
+ */
+public final class ActionContextUtil {
+
+    private ActionContextUtil() {
+    }
+
+    private static final Logger LOGGER = 
LoggerFactory.getLogger(ActionContextUtil.class);
+
+    /**
+     * Extracting context data from parameters
+     *
+     * @param targetParam the target param
+     * @return map the context
+     */
+    public static Map<String, Object> fetchContextFromObject(@Nonnull Object 
targetParam) {
+        return 
org.apache.seata.integration.tx.api.interceptor.ActionContextUtil.fetchContextFromObject(targetParam);
+    }
+
+    /**
+     * load param by the config of annotation, and then put into the action 
context
+     *
+     * @param paramType     the param type, 'param' or 'field'
+     * @param paramName     the param name
+     * @param paramValue    the param value
+     * @param annotation    the annotation on the param or field
+     * @param actionContext the action context
+     */
+    public static void loadParamByAnnotationAndPutToContext(@Nonnull final 
ParamType paramType, @Nonnull String paramName, Object paramValue,
+                                                            @Nonnull final 
BusinessActionContextParameter annotation, @Nonnull final Map<String, Object> 
actionContext) {
+        ActionContextUtil.loadParamByAnnotationAndPutToContext(paramType, 
paramName, paramValue, annotation, actionContext);
+    }
+
+
+    public static String getParamNameFromAnnotation(@Nonnull 
BusinessActionContextParameter annotation) {
+        return ActionContextUtil.getParamNameFromAnnotation(annotation);

Review Comment:
   same above.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to