Просмотр исходного кода

Remove slf4j dependency in sentinel-annotation-aspectj

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
master
Eric Zhao 5 лет назад
Родитель
Сommit
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;
}


Загрузка…
Отмена
Сохранить