public class FieldInterceptor2 extends EventProducer
Following code snippet is an example, how to initialize FieldInterceptor2:
InstrumentationContext ctx = new InstrumentationContext();
InstrumentationDescriptor id = new InstrumentationDescriptor();
id.addInclusionRule("samples.*");
ctx.addInstrumentationDescriptor(id);
FieldInterceptor2 fi = new FieldInterceptor2(id, "samples*", this);
FieldInterceptor2 intercepts only accessess to public fields.
NOTE: THIS CLASS IS OBSOLETE. USE FieldInterceptor INSTEAD
| Constructor and Description |
|---|
FieldInterceptor2(InstrumentationDescriptor id,
FieldHandler handler)
Constructor.
|
FieldInterceptor2(InstrumentationDescriptor id,
String[] resolutions,
FieldHandler handler)
Creates new FieldInterceptor2.
|
FieldInterceptor2(InstrumentationDescriptor id,
String resolution,
FieldHandler handler)
Creates new FieldInterceptor2.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getField(Object o,
String name)
Called by Jiapi runtime.
|
void |
setField(Object o,
String name,
Object value)
Called by Jiapi runtime.
|
getResolutions, isProtected, isProtected, match, protect, releasepublic FieldInterceptor2(InstrumentationDescriptor id, FieldHandler handler)
id - Instrumentation decsriptor, that this FieldInterceptor2
registers itself to.handler - FieldHandlerpublic FieldInterceptor2(InstrumentationDescriptor id, String resolution, FieldHandler handler)
id - Instrumentation decsriptor, that this FieldInterceptor2
registers itself to.resolution - Resolution, that is used to select which fields trigger
interceptionhandler - FieldHandlerpublic FieldInterceptor2(InstrumentationDescriptor id, String[] resolutions, FieldHandler handler)
id - Instrumentation decsriptor, that this FieldInterceptor2
registers itself to.resolutions - Resolutions, that is used to select which fields trigger
interceptionhandler - FieldHandlerpublic void setField(Object o, String name, Object value) throws Throwable
o - if target field is static, this parameter holds a Class of the
target field, otherwise this is the instance, that fieldset
should be acted on.name - Fully qualified name of the fieldvalue - Value to setThrowable - on errorpublic Object getField(Object o, String name) throws Throwable
o - if target field is static, this parameter holds a Class of the
target field, otherwise this is the instance, that fieldset
should be acted on.name - Fully qualified name of the fieldThrowable - on errorCopyright © 2017. All rights reserved.