Hi Laurent:
The info your requesting:
The root block is addressable via "/"
Sub-blocks are addressable via "/<block-name>/<block-name>
A service exported by a block is available via appending #<interface-name> to the URL.
Laurent Rieu wrote:
Hi,
I'm guessing that as the JNDI-zed way to access services is not that mature,
I have to do with the URL-ized way.
Its a minimal first cut. The better approach is a full JNDI implementation that handles the block protocol without requiring any Merlin API references.
According to the BlockURLHandler.parseURL() javadoc, Block URL are supposed to conform to one of the following patterns: block://localhost/root#org.apache.playground.Demo block://localhost/root/subcontainer/demo
/root#org.apache.playground.Demo
This is addressing a top level component (or container) named root.
This is not the same as addressing the top level container which is named "/".
Well, I'm having a single component deployed twice in two different containers, the root one and a 'test' one, as shown in the following block.xml file:
<block> <info> <name>root</name> </info> <implementation> <component name="resource-manager" class="test.services.resources.ResourceManagerImpl" activation="startup"> </component> <container name="test"> <component name="resource-manager" class="test.services.resources.ResourceManagerImpl" activation="startup"> </component> </container> </implementation> </block>
Fist, what's about this 'root' container ?
The name of a block is only relevant for sub containers.
There is an open question here - should Merlin establish a root container by default? In which case your assumptions o9n addressing would have worked. My feeling is that maybe we should do this - i.e. establish a root block automatically then add blocks and componets to the root.
Is it an implicit name (which has
nothing to do with the actual block name as declared in the block.xml file
?).
Yes.
<snip/>The fact is that trying to use the URL pattern [kernelURL]/root/resource-manager it looks like Merlin doesn't know about the 'root' path as shown in the stack trace below :
This works when I remove the 'root' element in the URL (([kernelURL]/resource-manager).
Yep - because your now addressing the top level block.
The following URL don't work either (maybe that is what's expected, but a litte documentation about the URL pattern would help ;-) ) : [kernelURL]/root#test.services.resources.ResourceManager
Because /root addresses a container or component named root containered within the top level container.
(test.services.resources.ResourceManager being the service interface exported by my component) [kernelURL]/root#test.services.resources.ResourceManagerImpl [kernelURL]/#test.services.resources.ResourceManager [kernelURL]/#test.services.resources.ResourceManagerImpl [kernelURL]/test#test.services.resources.ResourceManager [kernelURL]/test#test.services.resources.ResourceManagerImpl
Actually, the only URLs that work seem to be: [kernelURL]/resource-manager [kernelURL]/test/resource-manager
Laurent (who thinks this URL pattern should be clarified !)
:-)
Maybe should add an implict block as "/" so that /root makes sence) What are you thoughts on this?
SJM
--
Stephen J. McConnell mailto:[EMAIL PROTECTED] http://www.osm.net
Sent via James running under Merlin as an NT service. http://avalon.apache.org/sandbox/merlin
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
