Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
killuaz丶x
SkyWalking
提交
a7068a88
S
SkyWalking
项目概览
killuaz丶x
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a7068a88
编写于
7月 27, 2016
作者:
A
ascrutae
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "1. 去除Bytebuddy插件,改用Javassit插件增强"
This reverts commit
7ac79a3e
.
上级
64c65892
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
201 addition
and
34 deletion
+201
-34
skywalking-collector/skywalking-agent/src/main/java/com/ai/cloud/skywalking/agent/transformer/PluginsTransformer.java
...loud/skywalking/agent/transformer/PluginsTransformer.java
+0
-7
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/PluginException.java
.../java/com/ai/cloud/skywalking/plugin/PluginException.java
+1
-1
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/EnhanceClassEmptyException.java
...ywalking/plugin/exception/EnhanceClassEmptyException.java
+0
-7
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/EnhanceClassNotFoundException.java
...lking/plugin/exception/EnhanceClassNotFoundException.java
+0
-7
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/WitnessClassesCannotFound.java
...kywalking/plugin/exception/WitnessClassesCannotFound.java
+0
-7
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/FieldGetter.java
...ud/skywalking/plugin/interceptor/enhance/FieldGetter.java
+2
-3
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/FieldSetter.java
...ud/skywalking/plugin/interceptor/enhance/FieldSetter.java
+5
-0
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/MethodRegexMatcher.java
...alking/plugin/interceptor/matcher/MethodRegexMatcher.java
+42
-0
skywalking-collector/skywalking-api/src/main/resources/instance_method_call_origin_code.conf
.../src/main/resources/instance_method_call_origin_code.conf
+0
-0
skywalking-collector/skywalking-api/src/main/resources/static_method_call_origin_code.conf
...pi/src/main/resources/static_method_call_origin_code.conf
+0
-1
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/bytebuddy/ConstructorInterceptor.java
.../java/test/ai/cloud/bytebuddy/ConstructorInterceptor.java
+16
-0
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/bytebuddy/MethodInterceptor.java
.../test/java/test/ai/cloud/bytebuddy/MethodInterceptor.java
+23
-0
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/bytebuddy/SimulateMain.java
...i/src/test/java/test/ai/cloud/bytebuddy/SimulateMain.java
+58
-0
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/bytebuddy/SimulateMain2.java
.../src/test/java/test/ai/cloud/bytebuddy/SimulateMain2.java
+36
-0
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/bytebuddy/TestClass.java
...-api/src/test/java/test/ai/cloud/bytebuddy/TestClass.java
+17
-0
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/classes/skywalking-plugin.def
...omcat-7.x-8.x-plugin/target/classes/skywalking-plugin.def
+1
-1
未找到文件。
skywalking-collector/skywalking-agent/src/main/java/com/ai/cloud/skywalking/agent/transformer/PluginsTransformer.java
已删除
100644 → 0
浏览文件 @
64c65892
package
com.ai.cloud.skywalking.agent.transformer
;
/**
* Created by xin on 16/7/24.
*/
public
class
PluginsTransformer
{
}
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/
exception/
PluginException.java
→
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/PluginException.java
浏览文件 @
a7068a88
package
com.ai.cloud.skywalking.plugin
.exception
;
package
com.ai.cloud.skywalking.plugin
;
public
class
PluginException
extends
Exception
{
private
static
final
long
serialVersionUID
=
-
6020188711867490724L
;
...
...
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/EnhanceClassEmptyException.java
已删除
100644 → 0
浏览文件 @
64c65892
package
com.ai.cloud.skywalking.plugin.exception
;
/**
* Created by xin on 16/7/25.
*/
public
class
EnhanceClassEmptyException
{
}
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/EnhanceClassNotFoundException.java
已删除
100644 → 0
浏览文件 @
64c65892
package
com.ai.cloud.skywalking.plugin.exception
;
/**
* Created by xin on 16/7/25.
*/
public
class
EnhanceClassNotFoundException
{
}
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/WitnessClassesCannotFound.java
已删除
100644 → 0
浏览文件 @
64c65892
package
com.ai.cloud.skywalking.plugin.exception
;
/**
* Created by xin on 16/7/25.
*/
public
class
WitnessClassesCannotFound
{
}
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/
OriginCall
.java
→
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/
FieldGetter
.java
浏览文件 @
a7068a88
package
com.ai.cloud.skywalking.plugin.interceptor.enhance
;
public
interface
OriginCall
{
Object
call
();
public
interface
FieldGetter
{
Object
getValue
();
}
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/
OriginCallCodeGenerato
r.java
→
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/
FieldSette
r.java
浏览文件 @
a7068a88
package
com.ai.cloud.skywalking.plugin.interceptor.enhance
;
/**
* Created by xin on 16/7/26.
*/
public
class
OriginCallCodeGenerator
{
public
interface
FieldSetter
{
void
setValue
(
Object
value
);
}
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/MethodRegexMatcher.java
0 → 100644
浏览文件 @
a7068a88
package
com.ai.cloud.skywalking.plugin.interceptor.matcher
;
import
com.ai.cloud.skywalking.plugin.interceptor.MethodMatcher
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
nameMatches
;
public
class
MethodRegexMatcher
extends
MethodMatcher
{
public
MethodRegexMatcher
(
String
methodMatchDescribe
)
{
super
(
methodMatchDescribe
);
}
public
MethodRegexMatcher
(
String
methodMatchDescribe
,
int
argNum
)
{
super
(
methodMatchDescribe
,
argNum
);
}
public
MethodRegexMatcher
(
String
methodMatchDescribe
,
Class
<?>...
argTypeArray
)
{
super
(
methodMatchDescribe
,
argTypeArray
);
}
public
MethodRegexMatcher
(
Modifier
modifier
,
String
methodMatchDescribe
)
{
super
(
modifier
,
methodMatchDescribe
);
}
public
MethodRegexMatcher
(
Modifier
modifier
,
String
methodMatchDescribe
,
int
argNum
)
{
super
(
modifier
,
methodMatchDescribe
,
argNum
);
}
public
MethodRegexMatcher
(
Modifier
modifier
,
String
methodMatchDescribe
,
Class
<?>...
argTypeArray
)
{
super
(
modifier
,
methodMatchDescribe
,
argTypeArray
);
}
@Override
public
ElementMatcher
.
Junction
<
MethodDescription
>
buildMatcher
()
{
ElementMatcher
.
Junction
<
MethodDescription
>
matcher
=
nameMatches
(
getMethodMatchDescribe
());
return
mergeArgumentsIfNecessary
(
matcher
);
}
}
skywalking-collector/skywalking-api/src/main/resources/instance_method_call_origin_code.conf
已删除
100644 → 0
浏览文件 @
64c65892
skywalking-collector/skywalking-api/src/main/resources/static_method_call_origin_code.conf
已删除
100644 → 0
浏览文件 @
64c65892
new
Origin
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/bytebuddy/ConstructorInterceptor.java
0 → 100644
浏览文件 @
a7068a88
package
test.ai.cloud.bytebuddy
;
import
net.bytebuddy.implementation.bind.annotation.AllArguments
;
import
net.bytebuddy.implementation.bind.annotation.RuntimeType
;
import
net.bytebuddy.implementation.bind.annotation.This
;
public
class
ConstructorInterceptor
{
@RuntimeType
public
void
intercept
(
@AllArguments
Object
[]
allArguments
)
{
System
.
out
.
println
(
"ConstructorInterceptor size:"
+
allArguments
.
length
);
if
(
allArguments
.
length
>
0
){
System
.
out
.
println
(
"ConstructorInterceptor param[0]="
+
allArguments
[
0
]);
}
}
}
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/bytebuddy/MethodInterceptor.java
0 → 100644
浏览文件 @
a7068a88
package
test.ai.cloud.bytebuddy
;
import
java.lang.reflect.Method
;
import
java.util.concurrent.Callable
;
import
net.bytebuddy.implementation.bind.annotation.AllArguments
;
import
net.bytebuddy.implementation.bind.annotation.Origin
;
import
net.bytebuddy.implementation.bind.annotation.RuntimeType
;
import
net.bytebuddy.implementation.bind.annotation.SuperCall
;
import
net.bytebuddy.implementation.bind.annotation.This
;
public
class
MethodInterceptor
{
@RuntimeType
public
Object
intercept
(
@This
Object
obj
,
@AllArguments
Object
[]
allArguments
,
@Origin
Method
method
,
@SuperCall
Callable
<?>
zuper
){
try
{
return
method
.
getName
()
+
":intercept_"
+
zuper
.
call
();
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
return
null
;
}
}
}
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/bytebuddy/SimulateMain.java
0 → 100644
浏览文件 @
a7068a88
package
test.ai.cloud.bytebuddy
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
isConstructor
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
isMethod
;
import
net.bytebuddy.ByteBuddy
;
import
net.bytebuddy.dynamic.ClassFileLocator
;
import
net.bytebuddy.dynamic.loading.ClassLoadingStrategy
;
import
net.bytebuddy.dynamic.scaffold.subclass.ConstructorStrategy
;
import
net.bytebuddy.implementation.MethodDelegation
;
import
net.bytebuddy.implementation.SuperMethodCall
;
import
net.bytebuddy.pool.TypePool
;
public
class
SimulateMain
{
public
static
void
main
(
String
[]
args
)
throws
NoSuchFieldException
,
SecurityException
,
InstantiationException
,
IllegalAccessException
,
ClassNotFoundException
{
TypePool
typePool
=
TypePool
.
Default
.
ofClassPath
();
System
.
out
.
println
(
typePool
.
describe
(
"test.ai.cloud.bytebuddy.TestClass"
).
isResolved
());
Class
<?>
newClazz
=
new
ByteBuddy
()
.
redefine
(
typePool
.
describe
(
"test.ai.cloud.bytebuddy.TestClass"
)
.
resolve
(),
ClassFileLocator
.
ForClassLoader
.
ofClassPath
())
.
name
(
"test.ai.cloud.bytebuddy.TestClass$$Origin"
)
.
make
()
.
load
(
ClassLoader
.
getSystemClassLoader
(),
ClassLoadingStrategy
.
Default
.
INJECTION
).
getLoaded
();
TestClass
t22
=
(
TestClass
)
(
new
ByteBuddy
()
.
subclass
(
newClazz
,
ConstructorStrategy
.
Default
.
IMITATE_SUPER_CLASS
)
.
method
(
isMethod
())
.
intercept
(
MethodDelegation
.
to
(
new
MethodInterceptor
()))
.
constructor
(
isConstructor
())
.
intercept
(
MethodDelegation
.
to
(
new
ConstructorInterceptor
()).
andThen
(
SuperMethodCall
.
INSTANCE
))
.
name
(
"test.ai.cloud.bytebuddy.TestClass"
)
.
make
()
.
load
(
ClassLoader
.
getSystemClassLoader
(),
ClassLoadingStrategy
.
Default
.
INJECTION
).
getLoaded
()
.
newInstance
());
// System.out.println(t22.testA("1"));
TestClass
t
=
new
TestClass
(
"abc"
);
System
.
out
.
println
(
t
.
testA
(
"1"
));
t
=
new
TestClass
(
"abc"
);
System
.
out
.
println
(
t
.
testA
(
"1"
));
// TestClass t2 = null;
// try {
// t2 = (TestClass) Class.forName("test.ai.cloud.bytebuddy.TestClass")
// .newInstance();
// } catch (ClassNotFoundException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// System.out.println(t2.testA("1"));
}
}
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/bytebuddy/SimulateMain2.java
0 → 100644
浏览文件 @
a7068a88
package
test.ai.cloud.bytebuddy
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
isConstructor
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
net.bytebuddy.ByteBuddy
;
import
net.bytebuddy.dynamic.ClassFileLocator
;
import
net.bytebuddy.dynamic.loading.ClassLoadingStrategy
;
import
net.bytebuddy.implementation.MethodDelegation
;
import
net.bytebuddy.implementation.SuperMethodCall
;
import
net.bytebuddy.pool.TypePool
;
public
class
SimulateMain2
{
public
static
void
main
(
String
[]
args
)
throws
InstantiationException
,
IllegalAccessException
{
TypePool
typePool
=
TypePool
.
Default
.
ofClassPath
();
new
ByteBuddy
()
.
rebase
(
typePool
.
describe
(
"test.ai.cloud.bytebuddy.TestClass"
)
.
resolve
(),
ClassFileLocator
.
ForClassLoader
.
ofClassPath
())
.
method
(
named
(
"testA"
))
.
intercept
(
MethodDelegation
.
to
(
new
MethodInterceptor
()))
.
method
(
named
(
"testB"
))
.
intercept
(
MethodDelegation
.
to
(
new
MethodInterceptor
()))
.
constructor
(
isConstructor
())
.
intercept
(
MethodDelegation
.
to
(
new
ConstructorInterceptor
())
.
andThen
(
SuperMethodCall
.
INSTANCE
))
.
make
()
.
load
(
ClassLoader
.
getSystemClassLoader
(),
ClassLoadingStrategy
.
Default
.
INJECTION
).
getLoaded
();
TestClass
t
=
new
TestClass
(
"abc"
);
System
.
out
.
println
(
t
.
testA
(
"1"
));
}
}
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/bytebuddy/TestClass.java
0 → 100644
浏览文件 @
a7068a88
package
test.ai.cloud.bytebuddy
;
public
class
TestClass
{
public
TestClass
(){
//System.out.println("init:" + this.getClass().getName());
}
public
TestClass
(
String
tmp
){
//System.out.println("init:" + this.getClass().getName());
}
public
String
testA
(
String
aa
){
// throw new RuntimeException("adfasdfas");
return
"TestClass.testA"
;
}
}
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/classes/skywalking-plugin.def
浏览文件 @
a7068a88
com.ai.cloud.skywalking.plugin.tomcat
78x.define.Tomcat
PluginDefine
com.ai.cloud.skywalking.plugin.tomcat
8.define.Tomcat8
PluginDefine
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录