开发者

patching java reflect calls using AOP

I don't have a lot of experience with Jboss AOP and I'm just curious if it's possible to replace all calls like

Field f = foo.class.getDeclaredField("bar");
f.set(object, value);

with something like

Field f = foo.class.getDeclaredField("bar");
FieldSetCaller.invoke(f, object, value);

using Jboss AOP. FieldSetCaller is my own class.

I need to replace all Field.set开发者_StackOverflow社区 calls on the fly, without recompiling the code. Some third -party code I even cannot recompile because I don't have the source.

I can achieve this using java asm framework and I'm wandering if Jboss AOP can do it as well.

Just for information - my code is running on Jboss server 4.3.0

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜