瀏覽代碼

Remove slf4j dependency in sentinel-annotation-aspectj

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
master
Eric Zhao 5 年之前
父節點
當前提交
3109ac4bef
共有 2 個文件被更改,包括 5 次插入12 次删除
  1. +0
    -6
      sentinel-extension/sentinel-annotation-aspectj/pom.xml
  2. +5
    -6
      sentinel-extension/sentinel-annotation-aspectj/src/main/java/com/alibaba/csp/sentinel/annotation/aspectj/AbstractSentinelAspectSupport.java

+ 0
- 6
sentinel-extension/sentinel-annotation-aspectj/pom.xml 查看文件

@@ -32,12 +32,6 @@
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
</dependency>
</dependencies>

</project>

+ 5
- 6
sentinel-extension/sentinel-annotation-aspectj/src/main/java/com/alibaba/csp/sentinel/annotation/aspectj/AbstractSentinelAspectSupport.java 查看文件

@@ -16,6 +16,7 @@
package com.alibaba.csp.sentinel.annotation.aspectj;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.log.RecordLog;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.alibaba.csp.sentinel.slots.block.degrade.DegradeException;
import com.alibaba.csp.sentinel.util.MethodUtil;
@@ -23,8 +24,6 @@ import com.alibaba.csp.sentinel.util.StringUtil;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
@@ -32,11 +31,11 @@ import java.util.Arrays;

/**
* Some common functions for Sentinel annotation aspect.
*
* @author Eric Zhao
*/
public abstract class AbstractSentinelAspectSupport {

private final Logger logger = LoggerFactory.getLogger(this.getClass());

protected String getResourceName(String resourceName, Method method) {
// If resource name is present in annotation, use this value.
if (StringUtil.isNotBlank(resourceName)) {
@@ -154,7 +153,7 @@ public abstract class AbstractSentinelAspectSupport {
&& returnType.isAssignableFrom(method.getReturnType())
&& Arrays.equals(parameterTypes, method.getParameterTypes())) {

logger.info("Resolved method [{}] in class [{}]", name, clazz.getCanonicalName());
RecordLog.info("Resolved method [{0}] in class [{1}]", name, clazz.getCanonicalName());
return method;
}
}
@@ -164,7 +163,7 @@ public abstract class AbstractSentinelAspectSupport {
return findMethod(mustStatic, superClass, name, returnType, parameterTypes);
} else {
String methodType = mustStatic ? " static" : "";
logger.error("Cannot find{} method [{}] in class [{}] with parameters {}",
RecordLog.warn("Cannot find{0} method [{1}] in class [{2}] with parameters {3}",
methodType, name, clazz.getCanonicalName(), Arrays.toString(parameterTypes));
return null;
}


Loading…
取消
儲存