avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: [Fortress] Single Role, Multiple Components
Date Tue, 04 Mar 2003 19:42:09 GMT
J Aaron Farr wrote:
> --- Berin Loritsch <bloritsch@apache.org> wrote:
> 
>>J Aaron Farr wrote:
>>
>>>Now, if I use the service manager to lookup the role
>>>"com.company.component.RoleInterface" or RoleInterface.ROLE, I should get a
>>>ServiceSelector, correct?  In other words:
>>>
>>>  Object o = m_serviceManager.lookup(RoleInterface.ROLE);
>>
>>No.  That gets you the default implementation.
>>
> 
> 
> Is the default always the first one or is there a way to manually set that (in
> the config file for example)?

You can override the default by specifying the default="true" attribute.

NOTE: if there are two components, both specifying default="true", then
the last one wins.

For example:

   <componentOne id="one">
      <config>stuff</config>
   </componentOne>

   <componentTwo id="two" default="true">
      <config>stuff</config>
   </componentTwo>

Now the second component will be the default one.

And to prove the point of the NOTE:

   <componentOne id="one" default="true">
      <config>stuff</config>
   </componentOne>

   <componentTwo id="two" default="true">
      <config>stuff</config>
   </componentTwo>

the second is still the default implementation.

I can't remember if I have the container log that occurance or not.


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


Mime
View raw message