avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen McConnell <mcconn...@apache.org>
Subject Re: What is the primary purpose of Serviceable interface?
Date Thu, 22 Apr 2004 00:29:21 GMT
Nader Aeinehchi wrote:

> Stephen,
> 
> Thanks for the clarifications.
> 
> Here comes new questions based on
> 
> 1. Is Serviceable == ServiceConsumer in Merlin?  

It's not a definition I would use.

The Serviceable interface is just a interface that defines a delivery 
strategy.  Is is the definition of a mechanisms that a component 
implementation can use to receive a ServiceManager instance.

> If no, is there any
> ServiceConsumer like interface in Merlin?

Any component that is a consumer of external services needs to acquire a 
ServiceManager in order to lookup its dependents.  Merlin can provide a 
ServiceManager to a component using one of two possible delivery strategies:

    1. by supplying a populated ServiceManager as a constructor
       argument

    2. by invoking the service operation declared by the Serviceable
       interface

The entries in the supplied ServiceManager are established relative to 
the @avalon.dependency key="some-key" type="org.whatever.SomeService" 
tag declaration by the component.

> 2. What interface does a service provider implement in Merlin? Is there any?

A service provider declares that it provides a service using the 
@avalon.service type="org.whatever.SomeService" tag.  The value of the 
type attribute is typically an interface classname that the component 
will normally implement.

> If the component class needs a
> 
>>service manager, then the container will create a new service manager
>>based on the information in the component model.
> 
> 
> 3. Is service manager created on demand? Or is it some vital built-in
> component(service) of a given container?

On demand - as part of the lifecycle processing handled under the 
ComponentFactory class in the activation/impl package.

Cheers, Stephen.

-- 

|---------------------------------------|
| Magic by Merlin                       |
| Production by Avalon                  |
|                                       |
| http://avalon.apache.org              |
|---------------------------------------|

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


Mime
View raw message