Thank you, Stephen. I got the think running correctly now. To summarize and double check my understanding:
Where do I indicate/configure the implementation to use for the service?
Generally speaking you do not need to do anything. What Merlin does to locate a provider is:
1. scan the jar files in the container classloader and register the component types and the services they provide 2. creates deployment profiles a) because you were explicit by declaring a <component> in the block b) automatically via a profile packaged with a component type c) implicitly 3. candidate selection
But you can override the above by declared an explicit provider. There is an example of this in the following:
http://avalon.apache.org/merlin/starting/tutorial/dependencies/manual.html
I think there is another element necessary to make the picture complete:
<container name="resource-manager">
...
<services>
<service type="ch.xmatrix.resource.ResourceManager">
<source>facade</source>
</service>
</services>
<component name="facade" class="ch.xmatrix.resource.HierarchialResourceManagerFacade"/>
</container>
If I get it right, that's the location where the implementation for the service is specified.
The availability of the service is declared in the .xinfo file as a result of adding the @avalon.service tag. What the above declaration is doing is to declare that the container is acting as a composite component and can be made available (as a service provider) to any components. This is rather useful when writing standalone blocks (i.e. a block that is referenced directory as opposed to a block the enbedded inside a jar file or directory).
The primary impact of the above change that you are probably experiencing is that the service published by the "facard" component have become visible to components at the level of the "resource-manager" container.
* @avalon.service type="ch.xmatrix.resource.ResourceManager:1.0.0"
* @avalon.service type="ch.xmatrix.resource.ResourceManager" version="1.0"
Another thing confuses: Are the above two lines equivalent?
Yes.
Cheers, Stephen.
Thanks a lot for the help and your time Daniel
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--
|------------------------------------------------| | Magic by Merlin | | Production by Avalon | | | | http://avalon.apache.org/merlin | | http://dpml.net/merlin/distributions/latest | |------------------------------------------------|
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]