Niclas Hedhman wrote:
On Monday 08 September 2003 21:47, Stephen McConnell wrote:
If block A imports block B, and block B declares service B1 and B2, then
during assembly of components inside A, the imported container will be
considered as a candidate service provider. If A is contained (or
imported) in container X, and you want some service to be visible from
other components inside A, then you need to declare the export of these
service inside the defintion of container A.
I think even lawyer will have problems reading your definitions ;o)
But Ok, I get the message.
:-)
But it looks weird on paper.
Block X Block A Block J Block B Block K
Understand my containment graph.
I read somewhere that Classloaders are shared in containers, so what happens when Block K looks up, indirectly somehow, Block J and tries to access it??
Will that work... Looks suspiciously like a case a classloading problems.
This will work providing that the jar file for the APIs for the services exposed by Block J are included in a common parent classloader. In your example this means that the APIs need to be declared in Block X. It's all actually rather simple. Just make sure that APIs are exposed at a level common to the the provider and the consumer. Just for reference - you don't need to worry about duplicate classpath references - if a jar file is declared at a higher level, a lower level reference will be ignored. Also, if you attempt to deploy a component without the APIs declared in a sufficiently high scope, you will get a deployment exception. You can use the merlin:simulate or merlin:deploy goals to validate this at build-time if you want.
Steve.
Niclas
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--
Stephen J. McConnell mailto:[EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
