J Aaron Farr wrote:
--- Berin Loritsch <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to