Leo Sutic wrote:
From: Alex Karasulu [mailto:[EMAIL PROTECTED]

If you can centralize the event->method call transformation logic or event generate it from declarative meta data your really phat!

There's a general way of doing this:


Use a dynamic proxy.

yep. Here's a reasonably generic way to do it manually:


http://cvs.sourceforge.net/viewcvs.py/*checkout*/jicarilla/jicarilla-sandbox/platform/framework/impl/src/java/org/jicarilla/framework/AbstractAsyncEnabled.java?content-type=text%2Fplain&rev=1.2

and here's such a dynamic proxy:

http://cvs.sourceforge.net/viewcvs.py/*checkout*/jicarilla/jicarilla-sandbox/platform/framework/impl/src/java/com/leosimons/jicarilla/framework/Attic/AsyncProxy.java?content-type=text%2Fplain&rev=1.4

I kinda forgot why I dropped the dynamic proxy thing. I even made a configurable version at some point:

http://cvs.sourceforge.net/viewcvs.py/*checkout*/jicarilla/jicarilla-sandbox/platform/framework/impl/src/java/com/leosimons/jicarilla/framework/Attic/ConfigurableAsyncProxy.java?content-type=text%2Fplain&rev=1.3

its not difficult to imagine a container plugin that sets up these proxies based on, for example, an "async this" attribute. I even got halfway to doing just that with commons-sandbox-attributes & pico...

http://cvs.sourceforge.net/viewcvs.py/*checkout*/jicarilla/jicarilla-sandbox/platform/framework/api/src/java/jicarilla/attributes/Attic/Asyncable.java?content-type=text%2Fplain&rev=1.1

...its also possible to do this with an AOP framework. I think I did something like this using AspectWerkz, but I don't think I ever saved it anywhere.

But it starts getting close to a magic fountain real quick :D

XMLRPC, SOAP, etc, all those are also rather general ways of handling event<->method call transformations. I don't like most of em :D

--
cheers,

- Leo Simons

-----------------------------------------------------------------------
Weblog              -- http://leosimons.com/
IoC Component Glue  -- http://jicarilla.org/
Articles & Opinions -- http://articles.leosimons.com/
-----------------------------------------------------------------------
"We started off trying to set up a small anarchist community, but
 people wouldn't obey the rules."
                                                        -- Alan Bennett



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to