You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Peter Donald <do...@apache.org> on 2001/09/20 17:43:28 UTC
[phoenix] BlockEvent/BlockListener support
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: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
Re: [phoenix] BlockEvent/BlockListener support
Posted by Peter Donald <do...@apache.org>.
On Sun, 23 Sep 2001 09:17, Paul Hammant wrote:
> Is there suppot for multiple block listeners per sar?
yep. As many as you want.
> Though they are
> distributed in bar files, can they a) be blocks too or b) have
> interaction with blocks? People might resort to static stuff to make
> interactions possible.... :-(
They can't be Blocks but it is possible to interact with Blocks - actually
thats their whole purpose. So you may have a WebServiceListener that looks
for Blocks that export interfaces that extend WebService and then register
them with the "server" Block that exports WebService.
--
Cheers,
Pete
*-----------------------------------------------------*
| Never argue with an idiot, they'll drag you down to |
| their level, and beat you with experience |
*-----------------------------------------------------*
---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
Re: [phoenix] BlockEvent/BlockListener support
Posted by Peter Donald <do...@apache.org>.
On Sun, 23 Sep 2001 08:51, Paul Hammant wrote:
> >I ended up making listeners deployed from assembly.xml and can include
> >configuration from config.xml like blocks. Any objections?
>
> Sounds really cool. No objections here.....but have you though about
> future needs for permissions IRO this, i.e. does the assembler grant the
> right to listen to one or more blocks for changes, or ir it enough for
> the Java code to implement BlockListener for all to become apparent to
> them?
I don't think there is any issues here. If an assembler adds them into file
they want them to listenen. If not they don't ;) I don't think the number of
Blocks per application is significant enough to warrant filtering of events
etc.
--
Cheers,
Pete
---------------------------------------------------------------
The difference between genius, and stupidity? Genius has limits
---------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
Re: [phoenix] BlockEvent/BlockListener support
Posted by Paul Hammant <Pa...@yahoo.com>.
Peter,
>> I ended up making listeners deployed from assembly.xml and can
>> include configuration from config.xml like blocks. Any objections?
>>
> Sounds really cool. No objections here.....but have you though about
> future needs for permissions IRO this, i.e. does the assembler grant
> the right to listen to one or more blocks for changes, or ir it enough
> for the Java code to implement BlockListener for all to become
> apparent to them?
Hmmm, just digging a bit deeper, I've seen more of what you've done
(always more polite to look rather than guess ;-)
From assembly.xml :
<block-listener
class="org.apache.avalon.cornerstone.demos.simpleserver.SimpleBlockListener"
name="simple-listener" />
This looks to be indicating that it will listen to all blocks being
added,changed & deleted. If we need some pattern based filtering of
blocks, we can do it there .. another-day(tm).
Is there suppot for multiple block listeners per sar? Though they are
distributed in bar files, can they a) be blocks too or b) have
interaction with blocks? People might resort to static stuff to make
interactions possible.... :-(
Regards,
- Paul H
---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
Re: [phoenix] BlockEvent/BlockListener support
Posted by Paul Hammant <Pa...@yahoo.com>.
Peter,
>I ended up making listeners deployed from assembly.xml and can include
>configuration from config.xml like blocks. Any objections?
>
Sounds really cool. No objections here.....but have you though about
future needs for permissions IRO this, i.e. does the assembler grant the
right to listen to one or more blocks for changes, or ir it enough for
the Java code to implement BlockListener for all to become apparent to them?
Regards,
- Paul H
---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
Re: [phoenix] BlockEvent/BlockListener support
Posted by Peter Donald <do...@apache.org>.
Hi,
I ended up making listeners deployed from assembly.xml and can include
configuration from config.xml like blocks. Any objections?
On Fri, 21 Sep 2001 01:43, Peter Donald wrote:
> 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
*------------------------------------------------------*
| "Common sense is the collection of prejudices |
| acquired by age 18. " -Albert Einstein |
*------------------------------------------------------*
---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org