Pushing the envelope

Darren's take on Java, agile methods, cool open source stuff, interesting technologies and other random wanderings through the land of blog.
Updated: 26/01/2003; 11:49:36.
Places to go
Apache Jakarta Project
c2.com
ExtremeProgramming.org
OpenSymphony
XProgramming.com
XP Developer

People to see
Russell Beattie
Eugene Belyaev
Tony Bowden
Mike Cannon-Brookes
Jeff Duska
Paul Hammant
Scott Johnson
Brett Morgan
Rickard Öberg
James Strachan
Joe Walnes

Things to do

Subscribe to "Pushing the envelope" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.


That was the day
September 2002
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          
Aug   Oct



Archives
December 2002
November 2002
October 2002
September 2002
August 2002

Listening To


Valid RSS

Click here to visit the Radio UserLand website.

  13 September 2002

Following on from where sleep interrupted me...

Having thought about it some more, I'm not sure a dynamic proxy would be needed in this case.  If the app. container wrapped the component object inside a simple non-dynamic decorator object and handed that to anything that needed it, swapping the implementation could still be done on the fly just by changing the decorator's reference to the implementation.  Wouldn't be as cool though :)


7:16:05 AM      comment []

JMX and dynamic proxies.  This could be interesting.  One of the things I'm not fully up to speed on with JMX is how you actually interact with the MBeans.  Having managed, pluggable components is great, but my POJOs (plain old java objects) still need to access the things, and having the entire API exposed in the management interface sucks.  I'm having the seed of an idea, but can't quite verbalise it yet (not at my best at half-midnight).

Let's see.  Wrap the component in an MBean, and expose its management properties.  Fine.  Register the MBean in the server.  Expose a management operation that returns the implementation of your component.  (This is where it gets sketchy).  Place the implementation inside a dynamic proxy, and have the application container pass the proxy to any objects that need the component (inversion of control).  Do something with notifications so that the implementation object or app. server itself can be called back whenever a managed property is altered.  Retrieve the new component instance from the JMX server and place that inside the dynamic proxy, replacing the old one.  Any clients that have a reference to the proxy instance should now be calling the new component.  Hot swapping.  Hot damn.

Am I making any sense?


12:48:39 AM      comment []

© Copyright 2003 Darren Hobbs