1.保证拦截器在.def文件中定以后严格有序。

This commit is contained in:
wusheng 2016-03-16 15:07:32 +08:00
parent cc816aa51f
commit 80da19e610
2 changed files with 7 additions and 7 deletions

View File

@ -4,7 +4,8 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import com.ai.cloud.skywalking.util.StringUtil;
@ -12,7 +13,7 @@ import com.ai.cloud.skywalking.util.StringUtil;
public class PluginCfg {
public final static PluginCfg CFG = new PluginCfg();
private Set<String> interceptorClassList = new HashSet<String>();
private List<String> interceptorClassList = new ArrayList<String>();
private PluginCfg(){}
@ -30,7 +31,7 @@ public class PluginCfg {
}
}
public Set<String> getInterceptorClassList(){
public List<String> getInterceptorClassList(){
return interceptorClassList;
}
}

View File

@ -1,11 +1,10 @@
package com.ai.cloud.skywalking.plugin.interceptor;
import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.any;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
import java.util.Set;
import java.util.List;
import net.bytebuddy.ByteBuddy;
import net.bytebuddy.dynamic.ClassFileLocator;
@ -35,7 +34,7 @@ public class EnhanceClazz4Interceptor {
}
public void enhance() {
Set<String> interceptorClassList = PluginCfg.CFG
List<String> interceptorClassList = PluginCfg.CFG
.getInterceptorClassList();
for (String interceptorClassName : interceptorClassList) {