Hi, you've reached the website of Mark Menard, Freemason, developer, businessman, photographer, motorcyclist and all around nice guy.
The main joy in my life is Sylva, my loving partner and friend. (You will see plenty of pictures of her. Also check out our site.) My professonal career is running a consulting firm concentrating on business automation and custom software. I enjoy software development, motorcycles, photography, dancing, freemasonry and travel.
Here you will find galleries of my latest photos, thoughts on software development, freemasonry, the occassional politics, and other things. Enjoy your time here.
Mark
An ongoing photographic study of Freemasonry.
To contact Mark send an email to mark@mjm.net. You will receive an auto response from my mail server to verify you're not a spammer.
© Mark Menard 2002-2007
The same issue with Spring Reloading Script Proxy
Hi,
I stumbled in the same problem of Spring giving a Proxy object for scripts that are reloaded. I did some reflection investigation and found out that the actual script instance is behind $Proxy.targetSource.target. Now, if only Struts 2 could take ognl expressions for <action method="...">, we could write
<action ... method="myAction.targetSource.target.execute">...
and we could use the auto-reloading scripted beans from Spring context. (myAction is obviously the Spring bean)
I really don't see how the problem with reloaded script could be solved - because the reference to the script instance is already given away to other parts of the code, and you cannot change it, so you are forced to use a proxy.
On the other hand let's assume you added a new method (let's say "execute"). At the time of initial instantiation this method didn't exist, so you couldn't expose it in the Proxy. Then you add it, but the Proxy instance is already referenced by other parts of the application. So if someone did $Proxy.getClass().getMethod("execute"...) on the Proxy, there's no way for the Proxy to intercept it and return the newly defined script method (at least that I know of). Therefore the proxy is limited to exposing only well-known methods, defined in the script, such as those of the superclass and implemented interfaces.