I don't know exactly what the situation for Phoenix is (I'm using Fortress), but
I created a new container by subclassing from DefaultContainer and making
this container implement an interface which allows it to fetch multiple components:


public interface ProviderContainer {

Provider[] getProviders()

}

The ProviderContainerImpl then uses the map of the components from DefaultContainer
to return the appropriate ones (the ones that implement the requested ROLE).


Hope this helps, let me know if you need more detail, I don't have my code
handy right now,

- Filip
PS: All of these solutions are courtesy of Berin/Leo/... Just want to save them
some typing :-).


Raj Saini wrote:

Hi,

I am new to Avalon. For my project I have multiple blocks implementing single work interface. How can I lookup the multiple blocks with same ROLE? After going throgh the docs, I learnt that ServiceSelector.select(Object policy) may be the solution.

However, searching the mail archives and docs on avalon site did not make any break through. Can some one tell me what is the appropriate way to select/lookup multiple components with same role. It would be nice if I can get hands on sample code. I am using Phoenix 4.0.3.

Thanking you,

Raj Saini






--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to