Issue1673854

classification
Title: Java methods invocation interceptor
Type: rfe Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, dubnerm, pavel_krupets
Priority: normal Keywords:

Created on 2007-03-05.09:02:01 by pavel_krupets, last changed 2008-02-09.22:24:37 by cgroves.

Messages
msg3028 (view) Author: Pavel Krupets (pavel_krupets) Date: 2007-03-05.09:02:01
Hello,

I really need to intercept all Java methods invocations. And I'd like to have it ASAP. I'd really appreciate if you implement this feature. Thank you!

Need it for another open source project.
msg3029 (view) Author: Pavel Krupets (pavel_krupets) Date: 2007-03-05.09:03:38
Need to intercept in in Java like (it's just a quick example):

public void interceptor(Runnable call) {
  ... I'll do my stuff here
  call.run();
  ... continue doing my stuff
}
msg3030 (view) Author: Michael Dubner (dubnerm) Date: 2007-03-17.10:53:46
Isn't it what class derivation made for?
msg3031 (view) Author: Pavel Krupets (pavel_krupets) Date: 2007-03-17.13:01:08
What do you mean? I asked people and they said that I have to modify jython code. And I couldn't change code I invoke. I'll check it. If I need to override one method to do this this is what I need.

Thank you for your help.
msg3032 (view) Author: Pavel Krupets (pavel_krupets) Date: 2007-03-19.12:11:05
Maybe some one can help me with this one? I couldn't find single place from which jython invokes java methods.
msg3033 (view) Author: Charlie Groves (cgroves) Date: 2008-02-09.22:24:37
Jython analyzes the Java classes in PyJavaClass and uses that to extract Method and Field objects via reflection that it later uses to call back into Java.  You could add a special wrapper for the classes with calls you want to intercept with a new PyObjectAdapter that you add to the ExtensiblePyObjectAdapter returned by org.python.core.Py.getAdapter.
History
Date User Action Args
2007-03-05 09:02:01pavel_krupetscreate