alt.jiapi.interceptor
Class FieldInterceptor2

java.lang.Object
  extended by alt.jiapi.event.EventProducer
      extended by alt.jiapi.interceptor.FieldInterceptor2

public class FieldInterceptor2
extends EventProducer

FieldInterceptor2 intercepts public field accesses and delegates task to FieldHandler.

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

Version:
$Revision: 1.2 $ $Date: 2006/01/31 11:11:42 $
Author:
Mika Riekkinen

Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class alt.jiapi.event.EventProducer
getResolutions, isProtected, isProtected, match, protect, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldInterceptor2

public FieldInterceptor2(InstrumentationDescriptor id,
                         FieldHandler handler)
Constructor. Resolution is set to '*'.

Parameters:
id - Instrumentation decsriptor, that this FieldInterceptor2 registers itself to.
handler - FieldHandler

FieldInterceptor2

public FieldInterceptor2(InstrumentationDescriptor id,
                         java.lang.String[] resolutions,
                         FieldHandler handler)
Creates new FieldInterceptor2.

Parameters:
id - Instrumentation decsriptor, that this FieldInterceptor2 registers itself to.
resolutions - Resolutions, that is used to select which fields trigger interception
handler - FieldHandler

FieldInterceptor2

public FieldInterceptor2(InstrumentationDescriptor id,
                         java.lang.String resolution,
                         FieldHandler handler)
Creates new FieldInterceptor2. Resolution tells, which fields trigger interception.

Parameters:
id - Instrumentation decsriptor, that this FieldInterceptor2 registers itself to.
resolution - Resolution, that is used to select which fields trigger interception
handler - FieldHandler
Method Detail

getField

public java.lang.Object getField(java.lang.Object o,
                                 java.lang.String name)
                          throws java.lang.Throwable
Called by Jiapi runtime.

Parameters:
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 field
Throws:
java.lang.Throwable

setField

public void setField(java.lang.Object o,
                     java.lang.String name,
                     java.lang.Object value)
              throws java.lang.Throwable
Called by Jiapi runtime.

Parameters:
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 field
value - Value to set
Throws:
java.lang.Throwable


Copyright © 2001. Documenation generated August 26 2011.