Update Readme for JaxWS (#2190)
* Update Readme for JaxWS, add a test case for proxy invocation. * Added copyright notice, removed test-main. * Added copyright notice, removed test-main. * codenarc
This commit is contained in:
parent
e2d0dd7d4c
commit
3764f63935
|
@ -339,6 +339,7 @@ These are the supported libraries and frameworks:
|
|||
| [Hystrix](https://github.com/Netflix/Hystrix) | 1.4+ |
|
||||
| [JAX-RS](https://javaee.github.io/javaee-spec/javadocs/javax/ws/rs/package-summary.html) | 0.5+ |
|
||||
| [JAX-RS Client](https://javaee.github.io/javaee-spec/javadocs/javax/ws/rs/client/package-summary.html) | 2.0+ |
|
||||
| [JAX-WS](https://jakarta.ee/specifications/xml-web-services/2.3/apidocs/javax/xml/ws/package-summary.html) | 2.0+ (not including 3.x yet) |
|
||||
| [JDBC](https://docs.oracle.com/en/java/javase/11/docs/api/java.sql/java/sql/package-summary.html) | Java 7+ |
|
||||
| [Jedis](https://github.com/xetorthio/jedis) | 1.4+ |
|
||||
| [JMS](https://javaee.github.io/javaee-spec/javadocs/javax/jms/package-summary.html) | 1.1+ |
|
||||
|
|
|
@ -5,7 +5,7 @@ muzzle {
|
|||
group = "javax.xml.ws"
|
||||
module = "jaxws-api"
|
||||
versions = "[2.0,]"
|
||||
skipVersions += '2.1-1' // contains broken dependency
|
||||
skipVersions += ['2.1-1', '2.1EA2'] // contain broken dependencies
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
package io.opentelemetry.javaagent.instrumentation.jaxws.jws.v1_1
|
||||
|
||||
import io.opentelemetry.instrumentation.test.AgentTestRunner
|
||||
import java.lang.reflect.Proxy
|
||||
|
||||
class JwsAnnotationsTest extends AgentTestRunner {
|
||||
|
||||
|
@ -49,4 +50,27 @@ class JwsAnnotationsTest extends AgentTestRunner {
|
|||
})
|
||||
}
|
||||
|
||||
def "WebService via proxy must have span attributes from actual implementation"() {
|
||||
when:
|
||||
WebServiceDefinitionInterface proxy =
|
||||
Proxy.newProxyInstance(
|
||||
WebServiceFromInterface.getClassLoader(),
|
||||
[WebServiceDefinitionInterface] as Class[],
|
||||
new ProxyInvocationHandler(new WebServiceFromInterface())) as WebServiceDefinitionInterface
|
||||
proxy.partOfPublicInterface()
|
||||
|
||||
then:
|
||||
proxy.getClass() != WebServiceFromInterface
|
||||
assertTraces(1, {
|
||||
trace(0, 1) {
|
||||
span(0) {
|
||||
name "WebServiceFromInterface.partOfPublicInterface"
|
||||
attributes {
|
||||
attribute('code.function', 'partOfPublicInterface')
|
||||
attribute('code.namespace', 'io.opentelemetry.javaagent.instrumentation.jaxws.jws.v1_1.WebServiceFromInterface')
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package io.opentelemetry.javaagent.instrumentation.jaxws.jws.v1_1;
|
||||
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class ProxyInvocationHandler implements InvocationHandler {
|
||||
|
||||
WebServiceDefinitionInterface target;
|
||||
|
||||
public ProxyInvocationHandler(WebServiceFromInterface webServiceFromInterface) {
|
||||
target = webServiceFromInterface;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
||||
return method.invoke(target, args);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue