avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen McConnell <mcconn...@apache.org>
Subject Re: Event mechanism in Merlin
Date Fri, 09 Apr 2004 22:06:09 GMT
Nader Aeinehchi wrote:

> 1. Please forgive me for my ignorance, but is the difference facility and
> custom lifecycle extension?

A lifecycle extension is an addition plug-in stage that a component type 
can implement.  An extension interface must be declared and implemented 
by a component and the container locates another component to handle the 
stage during lifecycle processing.

> What is a facility?

A facility is a regular component that request access to the containment 
model (org.apache.avalon.composition.model.ContainmentModel).  With 
access to the model it is possible to all sorts of things - add new 
component models, inspect existing models, deploy components, shutdown 
components - reload entire containers, etc.

Basically a facility is a component that can totally change the behavior 
of the system.  For example the http facility dynamically scans the 
model looking for components that can handle http requests and 
automatically registers them with a http gateway.  The jmx facility 
scans component types for MBeans and registers them with a MBean server.

Here is an example that shows a component that access the containment model:

    /**
     * Creation of a new facility.
     *
     * @param context the supplied context
     * @avalon.entry key="urn:composition:containment.model"
     *    type="org.apache.avalon.composition.model.ContainmentModel"
     * @exception ContextException if a contextualization error occurs
     */
     public DemoFacility( final Logger logger, Context context )
       throws ContextException
     {
         m_logger = logger;
         m_model = (ContainmentModel) context.get(
            "urn:composition:containment.model" );
     }

Cheers, Steve.


> 
>>To me, an event-driven component
>>is a kissing cousin to a message-driven component, so I think a merlin
>>plug-in facility would handle this quite nicely.
> 
> 
> 2. Just for clarity, we are talking about asynchronous messages among
> various objects and components? Are not we?
> 
> 3. In Jini, there is Distributed Events.  Is this something that should be
> taken into consideration to handle events among various JVMs?
> 
> 
> 
> 
> Best Regards
> 
> --
> Nader Aeinehchi
> Aasenhagen 66 E
> 2020 Skedsmokorset
> NORWAY
> Direct and Mobile +47 41 44 29 57
> Tel (private): +47 64 83 09 08
> Fax +47 64 83 08 07
> www.aeinehchi.com
> 
> ----- Original Message -----
> From: "Timothy Bennett" <exterminatorx@comcast.net>
> To: <dev@avalon.apache.org>
> Sent: Friday, April 09, 2004 9:23 PM
> Subject: Re: Event mechanism in Merlin
> 
> 
> 
>>Alex Karasulu wrote:
>>
>>
>>>>-----Original Message-----
>>>>From: news [mailto:news@sea.gmane.org] On Behalf Of Timothy Bennett
>>>>Sent: Friday, April 09, 2004 2:59 PM
>>>>To: dev@avalon.apache.org
>>>>Subject: Re: Event mechanism in Merlin
>>>>
>>>>Alex Karasulu wrote:
>>>>
>>>>
>>>>
>>>>>What do you think about creating a custom lifecycle for the subscribe
>>>>>Operation on this event router/bus concept.  BTW Berin has already done
>>>>>this with GUIApp but I'd like to see this sort of thing make its way
>>>>>into Merlin.
>>>>>
>>>>
>>>>Alex, IMO I think this is better done as a facility instead of a custom
>>>>lifecycle extension.  In the way that we are doing HTTP-driven
>>>>components and (JMS) message-driven components using facilities, I think
>>>>a facility to implement event-driven components is a good candidate.
>>>
>>>
>>>Hmmm that does make more sense.  I think I agree with you.
>>>
>>>Alex
>>
>>This is basically the path that will be (is being) taken with Aaron's
>>MDS (Message-Driven Service) stuff.  In it's first incarnation, MDS was
>>an Avalon framework lifecycle extension that basically allowed you to
>>define a special custom component that was *triggered* by a JMS message.
>>  Good stuff and I used it some in the pre-3.2.x Merlin distros.
>>
>>With the advent of the facility capabilities in the more recent Merlin
>>versions, Aaron has thrown the MDS stuff into the facilities arena, and
>>we plan to implement an MDS facility.  To me, an event-driven component
>>is a kissing cousin to a message-driven component, so I think a merlin
>>plug-in facility would handle this quite nicely.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
>>For additional commands, e-mail: dev-help@avalon.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
> For additional commands, e-mail: dev-help@avalon.apache.org
> 
> 


-- 

|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/merlin/distributions/latest    |
|------------------------------------------------|

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Mime
View raw message