-
1. Re: Reopening getters/setters vs. field interception
bill.burke Feb 28, 2003 4:34 PM (in response to belaban)>
> If this is true, you guys win. But I fail to see how
> a reflective call will NOT call the implementation
> method and thus the indirected stack? The reflected
> call WILL end up in the getter/setter method and thus
> in our indirection first, won't it? What are you
> talking about bob, if you are right it is the end of
> the discussion and you win. But please explain the
> bypass on reflective calls.
>
We're talking reflection calls on fields not methods. so, java.lang.reflect.Field.set(obj, val) will not be intercepted. The way field interception is instrumented is that Javassist searches for code that references a field and inserts a call to the interceptor chain there instead of the field access. Field access is different than a method call in bytecode so you have to actually modify all classes that access a field if you want field interception.
I'm saying that this is a good thing that java.lang.reflect.Field is not intercepted. That way we can have easy non-intercepted access to fields.
Then again, we could easily implement everything we want to implement with only public method interception and the framework and semantics would be much simpler. AND, except for some bugs in redeployment, the AOP 1st iteration would be done for POJO.
Bill