Nicolai Wadstr�m wrote:
Hi,
I have a small problem referencing included blocks:
I have four components [A], [B], [C] and [D].
[A] provides a service that is used by the other three components and a number of other components in the future. The service is Repository (Database) and thus I only want one instance of this service.
Ok, no problem here.
Each of these components are packaged as .JAR-files with a block.xml to declare all dependencies (all of these use other .JAR libraries as well) each component have, then I have a "master" block.xml to bootstrap my server from where I include the four components, so that they will be loaded.
Are you including theses component using <component ..../> or <include.../>?
My problem is that unless I include classpath entries in the master block.xml for the dependencies of [A] and the [A] implementation .JAR itself Merlin will not be able to resolve the dependencies.
You need to include the service API into the container that is common to the components that are using or implementing the API. If you use a <component ../> directive, then you need to include the implementation jar. If you use the <include..> directive then you only need the service api.
Is there I way around this?
Have you seperated you API and implementation into seperate jar files? Are you using <include>?
Is it is now I you need a lot of knowledge about each of the components and what they might require to assemble them (which defeats some of the purpose of COP).
If you diffeerent componet groups are defined in a block and the block exports one or more services, and if you <import> that block (using a jar reference or a block refererence) then you should achive what you want. At the root level you not concerned with how a block delivers a service - your only interested in the service it delivers and the exposure of that service into a scope of the container you are including it within.
Cheers, Steve.
Regards, Nicolai
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--
Stephen J. McConnell mailto:[EMAIL PROTECTED]
|------------------------------------------------| | Magic by Merlin | | Production by Avalon | | | | http://avalon.apache.org/merlin | | http://dpml.net/ | |------------------------------------------------|
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
