|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectalt.jiapi.event.EventProducer
alt.jiapi.interceptor.FieldInterceptor
public class FieldInterceptor
InvocationInterceptor intercepts method invocations and delegates invocations to InvokeHandler.
Following code snippet is an example, how to initialize FieldInterceptor:
InstrumentationContext ctx = new InstrumentationContext();
InstrumentationDescriptor id = new InstrumentationDescriptor();
id.addInclusionRule("samples.*");
ctx.addInstrumentationDescriptor(id);
FieldInterceptor fi = new FieldInterceptor(id, "samples*", this);
FieldInterceptor intercepts only accessess to public fields.
NOTE: ONLY FIELD GETS ARE SUPPORTED AT THE MOMENT
| Constructor Summary | |
|---|---|
FieldInterceptor(InstrumentationDescriptor id,
AccessAdvisor advisor)
Constructor. |
|
FieldInterceptor(InstrumentationDescriptor id,
java.lang.String[] resolutions,
AccessAdvisor advisor)
Creates new InvocationInterceptor. |
|
FieldInterceptor(InstrumentationDescriptor id,
java.lang.String resolution,
AccessAdvisor advisor)
Creates new InvocationInterceptor. |
|
| Method Summary | |
|---|---|
java.lang.Object |
getField(java.lang.Object o,
java.lang.String name,
java.lang.Object value)
|
java.lang.Object |
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 |
|---|
public FieldInterceptor(InstrumentationDescriptor id,
AccessAdvisor advisor)
id - Instrumentation decsriptor, that this InvocationInterceptor
registers itself to.handler - InvocationHandler
public FieldInterceptor(InstrumentationDescriptor id,
java.lang.String[] resolutions,
AccessAdvisor advisor)
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 - InvocationHandler
public FieldInterceptor(InstrumentationDescriptor id,
java.lang.String resolution,
AccessAdvisor advisor)
id - Instrumentation decsriptor, that this InvocationInterceptor
registers itself to.resolution - Resolution, that is used to select which
methods will be intercepted.handler - InvocationHandler| Method Detail |
|---|
public java.lang.Object getField(java.lang.Object o,
java.lang.String name,
java.lang.Object value)
public java.lang.Object setField(java.lang.Object o,
java.lang.String name,
java.lang.Object value)
o - if field-access is being made to an static field,
this parameter holds a Class of that field,
otherwise this is the instance, that field-access is being
acted on.name - of the fieldvalue - value to set
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||