Hi Stephen
... When running "maven -execute target\*.jar -repository %MAVEN_HOME%/repository"
Just a note - I'm assuming you meant to say "merlin" not "maven". To make things easier you can simply use "merlinx" instead of "merlin" which will automatically switch to the maven repo.
Absolutely! It' just a typo in the mailing. I'll try merlinx.
* @avalon.dependency key="resource-manager" type="ch.xmatrix.resource.ResourceManager"
And presumably your implementation is doing something like: ResourceManager myManager = (ResourceManager) manager.lookup( "resource-manager" );
Right.
This is the only usage of the key declared in the @avalon.dependency key="resource-manager" declaration - its just saying to the container that when the component does a lookup its going to use the key "resource-manager".
Actual service resolution has nothing to do with names - instead its about resolving explicit, implicit and composite solutions in order to locate and provide the solution to the lookup request.
I love magic that does the work for me! But I need to understand then: Where do I indicate/configure the implementation to use for the service?
Generally speaking you do not need to do anything. What Merlin does is 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 - because you were explicit by declaring a <component> in the block - automatically via a profile packaged with a component type - 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
Exception: org.apache.avalon.activation.appliance.NoProviderDefinitionException Message: Unable to resolve dependency: [resource-manager] ch.xmatrix.resource.ResourceManager:1.0.0
This exception is occurring because Merlin cannot find a component that exports the ch.xmatrix.resource.ResourceManager:1.0.0 service. Does your component that provides this service actually publish it using the @avalon.service type="ch.xmatrix.resource.ResourceManager:1.0.0" tag?
Close. I added a javadoc tag in the HierarchialResourceManagerFacade that implements the ResourceManager interface:
* @avalon.service type="ch.xmatrix.resource.ResourceManager"
That's fine. If the tag is there and the avalon:meta goal has executed, and the xinfo is there - then everything should work *providing* the HierarchialResourceManagerFacade class is visible to the consumer (meaning that it is in the same or higher container).
If you use the -debug option - you will be able to confirm if the HierarchialResourceManagerFacade is being recognized as a valid component. For example, if I run the hello demo with -debug, I'll see the following line that confirms that the HelloComponent class has been registered within the tutorial container
[DEBUG ] (tutorial.classloader.types): registered [type:tutorial.HelloComponent/1].
Cheers, Stephen.
--
|------------------------------------------------| | 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]