Rakesh Bhakta wrote:
I am looking for some suggestions on managing internal jar dependencies. Ideally, I would like to create a single jar (with its own block-inf/block.xml file). Then, use this jar within a top level block.xml.
Like this: ------------------------------------ <container name="TopContainer" > <classloader> <classpath> <!-- no jars here, perhaps only platform/system.jar--> </classpath> </classloader>
<include name="CoreSystem" id="platform:system" version="1.0" />
<component name='AnotherConsole' class='platform.system.Console'
activation='startup' >
<configuration><port>9001</port> </configuration> </component> </container>
Now, if I leave out the definition for component "AnotherConsole", all works great.
What your describing sounds correct behavior. When you use the <include> statement you exposing a service into the parent container but you not exposing the classes or component model used to create that service.
Typically you would identify the api classes that need to be visible to service consumers and you would make sure these are available in your TopContainer classloader.
As far as any <component> declarations are concerned - you are restricted to the classes exposed in the current container and any classes available in the container which the current container is included within. In other words - you should only assume the classes declared in the <classloader> are in scope.
But as it, it gets numerous ClassNotFoundExceptions. All the required jars for "platform:system" are in its own block-inf/block.xml file; however, they are not visible to the new component "AnotherConsole".
I do not want to bring the jars to the "TopContainer" block. The idea being the user of my work should not need to know all my jar dependencies. Also, I do want my components in platform:system's block.xml to be deployed under CoreSystem.
You users are going to be exposed to at least one or more api jar files. When a user imports you block they need to have that api classes already inside their container.
I have experimented with Artifact; it either cannot solve my problem or I have not yet mastered it.
Artifact is just another (but more consistent) way of declaring a repository resources (which means that its not going to solve your problem). Over the history of Merlin about three different formats for referencing an repository resource have worked their way into the system and there is a concerted effort to get this down to one single protocol model.
I am using Merlin 3.3.0
Any suggestions are appreciated.
Main question - do you have the classes that make up the API of you services separate from the classes that deal with the implementation? If yes - then you clients need to be aware of this api and the address of your block.
Hope that clarifies things.
Steve.
Thanks, Rakesh
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--
|---------------------------------------| | Magic by Merlin | | Production by Avalon | | | | http://avalon.apache.org | |---------------------------------------|
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
