Hi,
I have committed partial support for Applications to add in BlockListeners
that get notified when blocks are added/removed from application. Currently
you can't actually use it as the assembly descriptor format needs to be
expanded to allow applications to add in listeners.
The BlockEvent contains information including
* block name
* block info object
* actual block instance
The reason for adding this listener to the Phoenix API is to allow the
following scenario. Say we have a listener that does the following. Every
time a block is added it searches the services the block exports and looks
for a service that extends "WebService" interface. If it finds such a service
exported by a block and it *also* finds another block that exports
WebServices (like Pauls recent Soapification efforts that export SOAP
WebServices) then it will register all the WebService objects with the
exporter.
So thus to export a Block as a web service you just have to implement an
interface that extends WebService, add this listener to application and ...
voila` ! It gets exported. The equivelent could be implemented for JMX, RMI,
JNDI or any other passive application-wide service. This will hopefully make
it much easier to add management into Avalon and we can do it in Application
rather than Kernel space - yay!
Hopefully this will solve all the issues of cooperation between "peer" blocks
that I have talked about in the past. So what do you think ?
Open Questions:
* Do you like it?
* Should Listeners be Configurable?
* Where/how should we setup listeners for deployment? (I am thinking
assembly.xml at this stage)
* Is there any other information that may potentially be needed by listeners?
* Is there any other events that we should have listeners for?
* anything else?
Okay _ I think I have hacked enough for my day off - nite ;)
--
Cheers,
Pete
---------------------------------------
Be nice to your friends. If it weren't
for them, you'd be a complete stranger.
---------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]