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,
java.lang.reflect.InvocationHandler handler)
Constructor.
|
InvocationInterceptor(InstrumentationDescriptor id,
java.lang.String[] resolutions,
java.lang.reflect.InvocationHandler handler)
Creates new InvocationInterceptor.
|
InvocationInterceptor(InstrumentationDescriptor id,
java.lang.String resolution,
java.lang.reflect.InvocationHandler handler)
Creates new InvocationInterceptor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
invokeMethod(java.lang.Object o,
java.lang.String name,
java.lang.Object[] args,
java.lang.String signature)
Called by Jiapi runtime.
|
getResolutions, isProtected, isProtected, match, protect, release
public InvocationInterceptor(InstrumentationDescriptor id, java.lang.reflect.InvocationHandler handler)
id
- Instrumentation decsriptor, that this InvocationInterceptor
registers itself to.handler
- InvocationHandlerpublic InvocationInterceptor(InstrumentationDescriptor id, java.lang.String[] resolutions, java.lang.reflect.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 InvocationInterceptor(InstrumentationDescriptor id, java.lang.String resolution, java.lang.reflect.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 java.lang.Object invokeMethod(java.lang.Object o, java.lang.String name, java.lang.Object[] args, java.lang.String signature) throws java.lang.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 methodjava.lang.Throwable
Copyright © 2001. Documenation generated October 18 2013.