public class InvocationInterceptor extends EventProducer
Following code snippet is an example, how to initialize InvocationInterceptor:
InstrumentationContext ctx = new InstrumentationContext();
InstrumentationDescriptor id = new InstrumentationDescriptor();
id.addInclusionRule("samples.*");
ctx.addInstrumentationDescriptor(id);
InvocationInterceptor ii = new InvocationInterceptor(id, "java*", this);
| Constructor and Description |
|---|
InvocationInterceptor(InstrumentationDescriptor id,
InvocationHandler handler)
Constructor.
|
InvocationInterceptor(InstrumentationDescriptor id,
String[] resolutions,
InvocationHandler handler)
Creates new InvocationInterceptor.
|
InvocationInterceptor(InstrumentationDescriptor id,
String resolution,
InvocationHandler handler)
Creates new InvocationInterceptor.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
invokeMethod(Object o,
String name,
Object[] args,
String signature)
Called by Jiapi runtime.
|
getResolutions, isProtected, isProtected, match, protect, releasepublic InvocationInterceptor(InstrumentationDescriptor id, InvocationHandler handler)
id - Instrumentation decsriptor, that this InvocationInterceptor
registers itself to.handler - InvocationHandlerpublic InvocationInterceptor(InstrumentationDescriptor id, String resolution, InvocationHandler handler)
id - Instrumentation decsriptor, that this InvocationInterceptor
registers itself to.resolution - Resolution, that is used to select which methods will be
intercepted.handler - InvocationHandlerpublic InvocationInterceptor(InstrumentationDescriptor id, String[] resolutions, InvocationHandler handler)
id - Instrumentation decsriptor, that this InvocationInterceptor
registers itself to.resolutions - Resolutions, that is used further to select which methods will
trigger events to be produced.handler - InvocationHandlerpublic Object invokeMethod(Object o, String name, Object[] args, String signature) throws Throwable
o - if invocation is being made to an static method, this
parameter holds a Class of the called method, otherwise this
is the instance, that invocation should be acted on.name - of the method to callargs - Arguments of the methodsignature - signatureThrowable - on errorCopyright © 2017. All rights reserved.