Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
山不在高_有仙则灵
SkyWalking
提交
6e0a2444
S
SkyWalking
项目概览
山不在高_有仙则灵
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
12
Star
0
Fork
2
代码
文件
提交
分支
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,发现更多精彩内容 >>
未验证
提交
6e0a2444
编写于
11月 26, 2020
作者:
Z
zifeihan
提交者:
GitHub
11月 26, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add the plugin for Apache CXF 3.x (#5887)
上级
53e42bce
变更
28
隐藏空白更改
内联
并排
Showing
28 changed file
with
1138 addition
and
1 deletion
+1138
-1
.github/workflows/plugins-test.2.yaml
.github/workflows/plugins-test.2.yaml
+1
-0
CHANGES.md
CHANGES.md
+1
-0
apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
...walking/apm/network/trace/component/ComponentsDefine.java
+2
-0
apm-sniffer/apm-sdk-plugin/cxf-3.x-plugin/pom.xml
apm-sniffer/apm-sdk-plugin/cxf-3.x-plugin/pom.xml
+53
-0
apm-sniffer/apm-sdk-plugin/cxf-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cxf/v3/client/MessageSenderInterceptorInterceptor.java
...in/cxf/v3/client/MessageSenderInterceptorInterceptor.java
+105
-0
apm-sniffer/apm-sdk-plugin/cxf-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cxf/v3/client/define/MessageSenderInterceptorInstrumentation.java
...lient/define/MessageSenderInterceptorInstrumentation.java
+74
-0
apm-sniffer/apm-sdk-plugin/cxf-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cxf/v3/server/AsyncInvokeConstructorInterceptor.java
...ugin/cxf/v3/server/AsyncInvokeConstructorInterceptor.java
+36
-0
apm-sniffer/apm-sdk-plugin/cxf-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cxf/v3/server/AsyncInvokeMethodInterceptor.java
...pm/plugin/cxf/v3/server/AsyncInvokeMethodInterceptor.java
+72
-0
apm-sniffer/apm-sdk-plugin/cxf-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cxf/v3/server/define/ServiceInvokerInterceptorInstrumentation.java
...rver/define/ServiceInvokerInterceptorInstrumentation.java
+93
-0
apm-sniffer/apm-sdk-plugin/cxf-3.x-plugin/src/main/resources/skywalking-plugin.def
...n/cxf-3.x-plugin/src/main/resources/skywalking-plugin.def
+18
-0
apm-sniffer/apm-sdk-plugin/pom.xml
apm-sniffer/apm-sdk-plugin/pom.xml
+1
-0
docs/en/setup/service-agent/java-agent/Plugin-list.md
docs/en/setup/service-agent/java-agent/Plugin-list.md
+2
-1
docs/en/setup/service-agent/java-agent/Supported-list.md
docs/en/setup/service-agent/java-agent/Supported-list.md
+1
-0
oap-server/server-bootstrap/src/main/resources/component-libraries.yml
...rver-bootstrap/src/main/resources/component-libraries.yml
+3
-0
test/plugin/scenarios/cxf-scenario/bin/startup.sh
test/plugin/scenarios/cxf-scenario/bin/startup.sh
+21
-0
test/plugin/scenarios/cxf-scenario/config/expectedData.yaml
test/plugin/scenarios/cxf-scenario/config/expectedData.yaml
+90
-0
test/plugin/scenarios/cxf-scenario/configuration.yml
test/plugin/scenarios/cxf-scenario/configuration.yml
+22
-0
test/plugin/scenarios/cxf-scenario/pom.xml
test/plugin/scenarios/cxf-scenario/pom.xml
+125
-0
test/plugin/scenarios/cxf-scenario/src/main/assembly/assembly.xml
...gin/scenarios/cxf-scenario/src/main/assembly/assembly.xml
+41
-0
test/plugin/scenarios/cxf-scenario/src/main/java/org/apache/skywalking/apm/testcase/cxf/Application.java
...a/org/apache/skywalking/apm/testcase/cxf/Application.java
+37
-0
test/plugin/scenarios/cxf-scenario/src/main/java/org/apache/skywalking/apm/testcase/cxf/CxfConfig.java
...ava/org/apache/skywalking/apm/testcase/cxf/CxfConfig.java
+67
-0
test/plugin/scenarios/cxf-scenario/src/main/java/org/apache/skywalking/apm/testcase/cxf/controller/CaseController.java
...kywalking/apm/testcase/cxf/controller/CaseController.java
+54
-0
test/plugin/scenarios/cxf-scenario/src/main/java/org/apache/skywalking/apm/testcase/cxf/entity/User.java
...a/org/apache/skywalking/apm/testcase/cxf/entity/User.java
+62
-0
test/plugin/scenarios/cxf-scenario/src/main/java/org/apache/skywalking/apm/testcase/cxf/service/UserService.java
...ache/skywalking/apm/testcase/cxf/service/UserService.java
+34
-0
test/plugin/scenarios/cxf-scenario/src/main/java/org/apache/skywalking/apm/testcase/cxf/service/UserServiceImpl.java
.../skywalking/apm/testcase/cxf/service/UserServiceImpl.java
+49
-0
test/plugin/scenarios/cxf-scenario/src/main/resources/application.yaml
...cenarios/cxf-scenario/src/main/resources/application.yaml
+23
-0
test/plugin/scenarios/cxf-scenario/src/main/resources/log4j2.xml
...ugin/scenarios/cxf-scenario/src/main/resources/log4j2.xml
+30
-0
test/plugin/scenarios/cxf-scenario/support-version.list
test/plugin/scenarios/cxf-scenario/support-version.list
+21
-0
未找到文件。
.github/workflows/plugins-test.2.yaml
浏览文件 @
6e0a2444
...
...
@@ -66,6 +66,7 @@ jobs:
-
spring-tx-scenario
-
struts2.3-scenario
-
struts2.5-scenario
-
cxf-scenario
steps
:
-
uses
:
actions/checkout@v2
with
:
...
...
CHANGES.md
浏览文件 @
6e0a2444
...
...
@@ -22,6 +22,7 @@ Release Notes.
*
Add the plugin for mssql-jdbc 6.x -> 9.x.
*
Fix the default ignore mechanism isn't accurate enough bug.
*
Add the plugin for spring-kafka 1.3.x.
*
Add the plugin for Apache CXF 3.x.
#### OAP-Backend
*
Add the
`@SuperDataset`
annotation for BrowserErrorLog.
...
...
apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
浏览文件 @
6e0a2444
...
...
@@ -190,4 +190,6 @@ public class ComponentsDefine {
public
static
final
OfficialComponent
DBCP
=
new
OfficialComponent
(
103
,
"dbcp"
);
public
static
final
OfficialComponent
MSSQL_JDBC_DRIVER
=
new
OfficialComponent
(
104
,
"mssql-jdbc-driver"
);
public
static
final
OfficialComponent
APACHE_CXF
=
new
OfficialComponent
(
105
,
"Apache-CXF"
);
}
apm-sniffer/apm-sdk-plugin/cxf-3.x-plugin/pom.xml
0 → 100644
浏览文件 @
6e0a2444
<!--
~ 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.
~
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
apm-sdk-plugin
</artifactId>
<groupId>
org.apache.skywalking
</groupId>
<version>
8.3.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apm-cxf-3.x-plugin
</artifactId>
<packaging>
jar
</packaging>
<name>
cxf-3.x-plugin
</name>
<url>
http://maven.apache.org
</url>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<cxf.version>
3.1.9
</cxf.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.apache.cxf
</groupId>
<artifactId>
cxf-rt-frontend-jaxws
</artifactId>
<version>
${cxf.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.apache.cxf
</groupId>
<artifactId>
cxf-rt-transports-http
</artifactId>
<version>
${cxf.version}
</version>
<scope>
provided
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
apm-sniffer/apm-sdk-plugin/cxf-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cxf/v3/client/MessageSenderInterceptorInterceptor.java
0 → 100644
浏览文件 @
6e0a2444
/*
* 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
org.apache.skywalking.apm.plugin.cxf.v3.client
;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.cxf.message.Message
;
import
org.apache.cxf.service.model.MessageInfo
;
import
org.apache.cxf.transport.http.Address
;
import
org.apache.skywalking.apm.agent.core.context.CarrierItem
;
import
org.apache.skywalking.apm.agent.core.context.ContextCarrier
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.context.tag.Tags
;
import
org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan
;
import
org.apache.skywalking.apm.agent.core.context.trace.SpanLayer
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
/**
* Used to intercept client requests and transparently transmit trace header and other information
*/
public
class
MessageSenderInterceptorInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
public
void
beforeMethod
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
MethodInterceptResult
result
)
throws
Throwable
{
Message
message
=
(
Message
)
allArguments
[
0
];
final
String
httpRequestMethod
=
(
String
)
message
.
get
(
Message
.
HTTP_REQUEST_METHOD
);
final
MessageInfo
messageInfo
=
(
MessageInfo
)
message
.
get
(
"org.apache.cxf.service.model.MessageInfo"
);
final
Address
address
=
(
Address
)
message
.
get
(
"http.connection.address"
);
if
(
null
==
httpRequestMethod
||
null
==
messageInfo
||
null
==
address
)
{
return
;
}
final
String
operationName
=
generateOperationName
(
messageInfo
,
address
);
AbstractSpan
span
=
ContextManager
.
createExitSpan
(
operationName
,
address
.
getURI
().
getAuthority
());
ContextCarrier
contextCarrier
=
new
ContextCarrier
();
ContextManager
.
inject
(
contextCarrier
);
span
.
setComponent
(
ComponentsDefine
.
APACHE_CXF
);
Tags
.
HTTP
.
METHOD
.
set
(
span
,
httpRequestMethod
);
Tags
.
URL
.
set
(
span
,
generateRequestURL
(
messageInfo
,
address
));
SpanLayer
.
asRPCFramework
(
span
);
//Set trace headers.
Map
protocolHeaders
=
(
Map
)
message
.
get
(
Message
.
PROTOCOL_HEADERS
);
CarrierItem
next
=
contextCarrier
.
items
();
while
(
next
.
hasNext
())
{
next
=
next
.
next
();
List
<
String
>
headerList
=
new
ArrayList
<>(
1
);
headerList
.
add
(
next
.
getHeadValue
());
protocolHeaders
.
put
(
next
.
getHeadKey
(),
headerList
);
}
}
private
String
generateOperationName
(
MessageInfo
messageInfo
,
Address
address
)
{
return
address
.
getURI
().
getPath
()
+
"/"
+
messageInfo
.
getOperation
().
getInputName
();
}
private
String
generateRequestURL
(
MessageInfo
messageInfo
,
Address
address
)
{
return
address
.
getString
()
+
"/"
+
messageInfo
.
getOperation
().
getInputName
();
}
@Override
public
Object
afterMethod
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
Object
ret
)
throws
Throwable
{
ContextManager
.
stopSpan
();
return
ret
;
}
@Override
public
void
handleMethodException
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
Throwable
t
)
{
ContextManager
.
activeSpan
().
log
(
t
);
}
}
apm-sniffer/apm-sdk-plugin/cxf-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cxf/v3/client/define/MessageSenderInterceptorInstrumentation.java
0 → 100644
浏览文件 @
6e0a2444
/*
* 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
org.apache.skywalking.apm.plugin.cxf.v3.client.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
public
class
MessageSenderInterceptorInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
/**
* Enhance class.
*/
private
static
final
String
ENHANCE_CLASS
=
"org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor"
;
/**
* Intercept class.
*/
private
static
final
String
METHODS_INTERCEPT_CLASS
=
"org.apache.skywalking.apm.plugin.cxf.v3.client.MessageSenderInterceptorInterceptor"
;
@Override
protected
ClassMatch
enhanceClass
()
{
return
byName
(
ENHANCE_CLASS
);
}
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[
0
];
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]
{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
"handleMessage"
);
}
@Override
public
String
getMethodsInterceptor
()
{
return
METHODS_INTERCEPT_CLASS
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
}
apm-sniffer/apm-sdk-plugin/cxf-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cxf/v3/server/AsyncInvokeConstructorInterceptor.java
0 → 100644
浏览文件 @
6e0a2444
/*
* 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
org.apache.skywalking.apm.plugin.cxf.v3.server
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor
;
/**
* Capture a snapshot for cross-thread propagation.
*/
public
class
AsyncInvokeConstructorInterceptor
implements
InstanceConstructorInterceptor
{
@Override
public
void
onConstruct
(
final
EnhancedInstance
objInst
,
final
Object
[]
allArguments
)
{
if
(
ContextManager
.
isActive
())
{
objInst
.
setSkyWalkingDynamicField
(
ContextManager
.
capture
());
}
}
}
apm-sniffer/apm-sdk-plugin/cxf-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cxf/v3/server/AsyncInvokeMethodInterceptor.java
0 → 100644
浏览文件 @
6e0a2444
/*
* 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
org.apache.skywalking.apm.plugin.cxf.v3.server
;
import
java.lang.reflect.Method
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.context.ContextSnapshot
;
import
org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan
;
import
org.apache.skywalking.apm.agent.core.context.trace.SpanLayer
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
/**
* Create a new span and associate the existing link.
*/
public
class
AsyncInvokeMethodInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
public
void
beforeMethod
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
MethodInterceptResult
result
)
{
AbstractSpan
span
=
ContextManager
.
createLocalSpan
(
"/CXF/AsyncInvoke"
);
span
.
setComponent
(
ComponentsDefine
.
APACHE_CXF
);
SpanLayer
.
asRPCFramework
(
span
);
final
Object
storedField
=
objInst
.
getSkyWalkingDynamicField
();
if
(
storedField
!=
null
)
{
final
ContextSnapshot
contextSnapshot
=
(
ContextSnapshot
)
storedField
;
ContextManager
.
continued
(
contextSnapshot
);
}
}
@Override
public
Object
afterMethod
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
Object
ret
)
{
final
Object
storedField
=
objInst
.
getSkyWalkingDynamicField
();
if
(
storedField
!=
null
)
{
ContextManager
.
stopSpan
();
}
return
ret
;
}
@Override
public
void
handleMethodException
(
final
EnhancedInstance
objInst
,
final
Method
method
,
final
Object
[]
allArguments
,
final
Class
<?>[]
argumentsTypes
,
final
Throwable
t
)
{
if
(
ContextManager
.
isActive
())
{
ContextManager
.
activeSpan
().
log
(
t
);
}
}
}
apm-sniffer/apm-sdk-plugin/cxf-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cxf/v3/server/define/ServiceInvokerInterceptorInstrumentation.java
0 → 100644
浏览文件 @
6e0a2444
/*
* 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
org.apache.skywalking.apm.plugin.cxf.v3.server.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
any
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArguments
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
public
class
ServiceInvokerInterceptorInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
/**
* Enhance class.
*/
private
static
final
String
ENHANCE_CLASS
=
"org.apache.cxf.interceptor.ServiceInvokerInterceptor$1"
;
/**
* Constructor intercept class.
*/
private
static
final
String
CONSTRUCTOR_INTERCEPTOR
=
"org.apache.skywalking.apm.plugin.cxf.v3.server.AsyncInvokeConstructorInterceptor"
;
/**
* method intercept class.
*/
private
static
final
String
METHOD_INTERCEPTOR
=
"org.apache.skywalking.apm.plugin.cxf.v3.server.AsyncInvokeMethodInterceptor"
;
@Override
protected
ClassMatch
enhanceClass
()
{
return
byName
(
ENHANCE_CLASS
);
}
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[]
{
new
ConstructorInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getConstructorMatcher
()
{
return
any
();
}
@Override
public
String
getConstructorInterceptor
()
{
return
CONSTRUCTOR_INTERCEPTOR
;
}
}
};
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]
{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
"run"
).
and
(
takesArguments
(
0
));
}
@Override
public
String
getMethodsInterceptor
()
{
return
METHOD_INTERCEPTOR
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
}
apm-sniffer/apm-sdk-plugin/cxf-3.x-plugin/src/main/resources/skywalking-plugin.def
0 → 100644
浏览文件 @
6e0a2444
# 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.
apache-cxf-3.x=org.apache.skywalking.apm.plugin.cxf.v3.client.define.MessageSenderInterceptorInstrumentation
apache-cxf-3.x=org.apache.skywalking.apm.plugin.cxf.v3.server.define.ServiceInvokerInterceptorInstrumentation
\ No newline at end of file
apm-sniffer/apm-sdk-plugin/pom.xml
浏览文件 @
6e0a2444
...
...
@@ -106,6 +106,7 @@
<module>
dbcp-2.x-plugin
</module>
<module>
mssql-jtds-1.x-plugin
</module>
<module>
mssql-jdbc-plugin
</module>
<module>
cxf-3.x-plugin
</module>
</modules>
<packaging>
pom
</packaging>
...
...
docs/en/setup/service-agent/java-agent/Plugin-list.md
浏览文件 @
6e0a2444
...
...
@@ -111,4 +111,5 @@
-
xxl-job-2.x
-
zookeeper-3.4.x
-
mssql-jtds-1.x
-
mssql-jdbc
\ No newline at end of file
-
mssql-jdbc
-
apache-cxf-3.x
\ No newline at end of file
docs/en/setup/service-agent/java-agent/Supported-list.md
浏览文件 @
6e0a2444
...
...
@@ -54,6 +54,7 @@ metrics based on the tracing data.
*
[
Finagle
](
https://github.com/twitter/finagle
)
6.44.0 -> 20.1.0 (6.25.0 -> 6.44.0 not tested)
*
[
Brpc-Java
](
https://github.com/baidu/brpc-java
)
2.3.7 -> 2.5.3
*
[
Thrift
](
https://github.com/apache/thrift/tree/master/lib/java
)
0.10.0 -> 0.12.0
*
[
Apache CXF
](
https://github.com/apache/cxf
)
3.x
*
MQ
*
[
RocketMQ
](
https://github.com/apache/rocketmq
)
4.x
*
[
Kafka
](
http://kafka.apache.org
)
0.11.0.0 -> 1.0
...
...
oap-server/server-bootstrap/src/main/resources/component-libraries.yml
浏览文件 @
6e0a2444
...
...
@@ -344,6 +344,9 @@ dbcp:
mssql-jdbc-driver
:
id
:
104
languages
:
Java
Apache-CXF
:
id
:
105
languages
:
Java
# .NET/.NET Core components
# [3000, 4000) for C#/.NET only
...
...
test/plugin/scenarios/cxf-scenario/bin/startup.sh
0 → 100644
浏览文件 @
6e0a2444
#!/bin/bash
#
# 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.
home
=
"
$(
cd
"
$(
dirname
$0
)
"
;
pwd
)
"
java
-jar
${
agent_opts
}
${
home
}
/../libs/cxf-scenario.jar &
\ No newline at end of file
test/plugin/scenarios/cxf-scenario/config/expectedData.yaml
0 → 100644
浏览文件 @
6e0a2444
# 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.
segmentItems
:
-
serviceName
:
cxf-scenario
segmentSize
:
ge
4
segments
:
-
segmentId
:
not
null
spans
:
-
operationName
:
/cxf-scenario/soap/user
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
1
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/cxf-scenario/soap/user'
}
-
{
key
:
http.method
,
value
:
POST
}
refs
:
-
{
parentEndpoint
:
/cxf-scenario/case/cxf-scenario
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
cxf-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/CXF/AsyncInvoke
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
RPCFramework
startTime
:
nq
0
endTime
:
nq
0
componentId
:
105
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
'
false'
refs
:
-
{
parentEndpoint
:
/cxf-scenario/soap/user
,
networkAddress
:
'
'
,
refType
:
CrossThread
,
parentSpanId
:
0
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
cxf-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/cxf-scenario/soap/user/getUser
operationId
:
0
parentSpanId
:
0
spanId
:
1
spanLayer
:
RPCFramework
startTime
:
nq
0
endTime
:
nq
0
componentId
:
105
isError
:
false
spanType
:
Exit
peer
:
localhost:8080
skipAnalysis
:
false
tags
:
-
{
key
:
http.method
,
value
:
POST
}
-
{
key
:
url
,
value
:
'
http://localhost:8080/cxf-scenario/soap/user/getUser'
}
-
operationName
:
/cxf-scenario/case/cxf-scenario
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
1
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/cxf-scenario/case/cxf-scenario'
}
-
{
key
:
http.method
,
value
:
GET
}
\ No newline at end of file
test/plugin/scenarios/cxf-scenario/configuration.yml
0 → 100644
浏览文件 @
6e0a2444
# 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.
type
:
jvm
entryService
:
http://localhost:8080/cxf-scenario/case/cxf-scenario
healthCheck
:
http://localhost:8080/cxf-scenario/case/healthCheck
startScript
:
./bin/startup.sh
environment
:
dependencies
:
\ No newline at end of file
test/plugin/scenarios/cxf-scenario/pom.xml
0 → 100644
浏览文件 @
6e0a2444
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<groupId>
org.apache.skywalking.apm.testcase
</groupId>
<artifactId>
cxf-scenario
</artifactId>
<version>
1.0.0
</version>
<packaging>
jar
</packaging>
<modelVersion>
4.0.0
</modelVersion>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<compiler.version>
1.8
</compiler.version>
<test.framework.version>
3.1.9
</test.framework.version>
<docker.image.version>
${test.framework.version}
</docker.image.version>
<spring-boot-version>
2.1.6.RELEASE
</spring-boot-version>
</properties>
<name>
skywalking-cxf-scenario
</name>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<version>
${spring-boot-version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-logging
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-log4j2
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.cxf
</groupId>
<artifactId>
cxf-rt-frontend-jaxws
</artifactId>
<version>
${test.framework.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.cxf
</groupId>
<artifactId>
cxf-rt-transports-http
</artifactId>
<version>
${test.framework.version}
</version>
</dependency>
</dependencies>
<build>
<finalName>
cxf-scenario
</finalName>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
${compiler.version}
</source>
<target>
${compiler.version}
</target>
<encoding>
${project.build.sourceEncoding}
</encoding>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<executions>
<execution>
<id>
assemble
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
<configuration>
<descriptors>
<descriptor>
src/main/assembly/assembly.xml
</descriptor>
</descriptors>
<outputDirectory>
./target/
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
test/plugin/scenarios/cxf-scenario/src/main/assembly/assembly.xml
0 → 100644
浏览文件 @
6e0a2444
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<assembly
xmlns=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"
>
<formats>
<format>
zip
</format>
</formats>
<fileSets>
<fileSet>
<directory>
./bin
</directory>
<fileMode>
0775
</fileMode>
</fileSet>
</fileSets>
<files>
<file>
<source>
${project.build.directory}/cxf-scenario.jar
</source>
<outputDirectory>
./libs
</outputDirectory>
<fileMode>
0775
</fileMode>
</file>
</files>
</assembly>
test/plugin/scenarios/cxf-scenario/src/main/java/org/apache/skywalking/apm/testcase/cxf/Application.java
0 → 100644
浏览文件 @
6e0a2444
/*
* 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
org.apache.skywalking.apm.testcase.cxf
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringBootConfiguration
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.web.bind.annotation.RestController
;
@SpringBootApplication
public
class
Application
{
public
static
void
main
(
String
[]
args
)
{
try
{
SpringApplication
.
run
(
Application
.
class
,
args
);
}
catch
(
Exception
e
)
{
// Never do this
}
}
}
test/plugin/scenarios/cxf-scenario/src/main/java/org/apache/skywalking/apm/testcase/cxf/CxfConfig.java
0 → 100644
浏览文件 @
6e0a2444
/*
* 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
org.apache.skywalking.apm.testcase.cxf
;
import
java.util.concurrent.ArrayBlockingQueue
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
import
javax.xml.ws.Endpoint
;
import
org.apache.cxf.Bus
;
import
org.apache.cxf.bus.spring.SpringBus
;
import
org.apache.cxf.jaxws.EndpointImpl
;
import
org.apache.cxf.transport.servlet.CXFServlet
;
import
org.apache.skywalking.apm.testcase.cxf.service.UserService
;
import
org.apache.skywalking.apm.testcase.cxf.service.UserServiceImpl
;
import
org.springframework.boot.web.servlet.ServletRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.Ordered
;
@Configuration
public
class
CxfConfig
{
private
final
Executor
executor
=
new
ThreadPoolExecutor
(
2
,
2
,
60
,
TimeUnit
.
SECONDS
,
new
ArrayBlockingQueue
(
100
));
@Bean
public
ServletRegistrationBean
servletRegistrationBean
()
{
ServletRegistrationBean
bean
=
new
ServletRegistrationBean
(
new
CXFServlet
(),
"/soap/*"
);
bean
.
setLoadOnStartup
(
1
);
bean
.
setOrder
(
Ordered
.
LOWEST_PRECEDENCE
);
return
bean
;
}
@Bean
(
name
=
Bus
.
DEFAULT_BUS_ID
)
public
SpringBus
springBus
()
{
return
new
SpringBus
();
}
@Bean
public
UserService
userService
()
{
return
new
UserServiceImpl
();
}
@Bean
public
Endpoint
endpoint
()
{
EndpointImpl
endpoint
=
new
EndpointImpl
(
springBus
(),
userService
());
endpoint
.
setExecutor
(
executor
);
endpoint
.
publish
(
"/user"
);
return
endpoint
;
}
}
test/plugin/scenarios/cxf-scenario/src/main/java/org/apache/skywalking/apm/testcase/cxf/controller/CaseController.java
0 → 100644
浏览文件 @
6e0a2444
/*
* 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
org.apache.skywalking.apm.testcase.cxf.controller
;
import
org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/case"
)
public
class
CaseController
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
CaseController
.
class
);
@ResponseBody
@RequestMapping
(
"/healthCheck"
)
public
String
healthCheck
()
{
return
"Success"
;
}
@ResponseBody
@RequestMapping
(
"/cxf-scenario"
)
public
String
cxfCase
()
{
try
{
JaxWsDynamicClientFactory
dcf
=
JaxWsDynamicClientFactory
.
newInstance
();
org
.
apache
.
cxf
.
endpoint
.
Client
client
=
dcf
.
createClient
(
"http://localhost:8080/cxf-scenario/soap/user?wsdl"
);
Object
[]
objects
=
client
.
invoke
(
"getUser"
,
1L
);
LOGGER
.
info
(
objects
[
0
].
toString
());
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
""
,
e
);
}
return
"success"
;
}
}
test/plugin/scenarios/cxf-scenario/src/main/java/org/apache/skywalking/apm/testcase/cxf/entity/User.java
0 → 100644
浏览文件 @
6e0a2444
/*
* 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
org.apache.skywalking.apm.testcase.cxf.entity
;
import
java.io.Serializable
;
import
java.util.Date
;
public
class
User
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5939599230753662529L
;
private
Long
userId
;
private
String
username
;
private
Date
gmtCreate
;
public
Long
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Long
userId
)
{
this
.
userId
=
userId
;
}
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
Date
getGmtCreate
()
{
return
gmtCreate
;
}
public
void
setGmtCreate
(
Date
gmtCreate
)
{
this
.
gmtCreate
=
gmtCreate
;
}
@Override
public
String
toString
()
{
return
"User{"
+
"userId="
+
userId
+
", username='"
+
username
+
'\''
+
", gmtCreate="
+
gmtCreate
+
'}'
;
}
}
test/plugin/scenarios/cxf-scenario/src/main/java/org/apache/skywalking/apm/testcase/cxf/service/UserService.java
0 → 100644
浏览文件 @
6e0a2444
/*
* 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
org.apache.skywalking.apm.testcase.cxf.service
;
import
javax.jws.WebMethod
;
import
javax.jws.WebParam
;
import
javax.jws.WebService
;
import
org.apache.skywalking.apm.testcase.cxf.entity.User
;
@WebService
public
interface
UserService
{
@WebMethod
String
getName
(
@WebParam
(
name
=
"userId"
)
Long
userId
);
@WebMethod
User
getUser
(
Long
userId
);
}
test/plugin/scenarios/cxf-scenario/src/main/java/org/apache/skywalking/apm/testcase/cxf/service/UserServiceImpl.java
0 → 100644
浏览文件 @
6e0a2444
/*
* 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
org.apache.skywalking.apm.testcase.cxf.service
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
javax.jws.WebService
;
import
org.apache.skywalking.apm.testcase.cxf.entity.User
;
@WebService
public
class
UserServiceImpl
implements
UserService
{
private
Map
<
Long
,
User
>
userMap
=
new
HashMap
<
Long
,
User
>();
public
UserServiceImpl
()
{
User
user
=
new
User
();
user
.
setUserId
(
1L
);
user
.
setUsername
(
"skywalking"
);
user
.
setGmtCreate
(
new
Date
());
userMap
.
put
(
user
.
getUserId
(),
user
);
}
@Override
public
String
getName
(
Long
userId
)
{
return
"hello"
+
userId
;
}
@Override
public
User
getUser
(
Long
userId
)
{
return
userMap
.
get
(
userId
);
}
}
test/plugin/scenarios/cxf-scenario/src/main/resources/application.yaml
0 → 100644
浏览文件 @
6e0a2444
#
# 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.
#
#
server
:
port
:
8080
servlet
:
context-path
:
/cxf-scenario
logging
:
config
:
classpath:log4j2.xml
\ No newline at end of file
test/plugin/scenarios/cxf-scenario/src/main/resources/log4j2.xml
0 → 100644
浏览文件 @
6e0a2444
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<Configuration
status=
"WARN"
>
<Appenders>
<Console
name=
"Console"
target=
"SYSTEM_ERR"
>
<PatternLayout
charset=
"UTF-8"
pattern=
"[%d{yyyy-MM-dd HH:mm:ss:SSS}] [%p] - %l - %m%n"
/>
</Console>
</Appenders>
<Loggers>
<Root
level=
"WARN"
>
<AppenderRef
ref=
"Console"
/>
</Root>
</Loggers>
</Configuration>
\ No newline at end of file
test/plugin/scenarios/cxf-scenario/support-version.list
0 → 100644
浏览文件 @
6e0a2444
# 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
# "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.
3.0.9
3.1.9
3.2.7
3.3.5
3.4.1
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录