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,
java.lang.String[] resolutions,
FieldHandler handler)
Creates new FieldInterceptor2.
|
FieldInterceptor2(InstrumentationDescriptor id,
java.lang.String resolution,
FieldHandler handler)
Creates new FieldInterceptor2.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getField(java.lang.Object o,
java.lang.String name)
Called by Jiapi runtime.
|
void |
setField(java.lang.Object o,
java.lang.String name,
java.lang.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, java.lang.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 FieldInterceptor2(InstrumentationDescriptor id, java.lang.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 java.lang.Object getField(java.lang.Object o,
java.lang.String name)
throws java.lang.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 fieldjava.lang.Throwablepublic void setField(java.lang.Object o,
java.lang.String name,
java.lang.Object value)
throws java.lang.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 setjava.lang.ThrowableCopyright © 2001. Documenation generated January 12 2013.