Peter,

If I get hold of a service manager one can query a component based on the ROLE so far so good. But suppose one has delcared multiple instances of a block in the assembly.xml. When I have declared the using and the used block in assembly.xml I have determined which instance exactly the using component should use. Now when I'm using the service manager from a non-block component, that is a component that does not appear in assembly.xml, how would the service manager know which block instance to pass back to the caller?/
From a non-block or non-block accessible class, you would separate multiple instances of the same servoce by choosing different names for them.

A slower (but known to work) way would be to use the transport package formerly from cornerstone but now part of altrmi.:

See the http://cvs.apache.org/viewcvs/jakarta-avalon-apps/demo/ demos. There is an altemi demo. It has an assembly ...

http://cvs.apache.org/viewcvs/jakarta-avalon-apps/demo/src/conf/avalon-altrmidemo-assembly.xml

...and a config ..

http://cvs.apache.org/viewcvs/jakarta-avalon-apps/demo/src/conf/avalon-altrmidemo-config.xml

... that shows how a block us published to a subscriber that it not necessarily under phonix/block/component control

Now, the client for this demo is a mainable class, but it could as well be a servlet (in the same VM or not). The flaw in this approach is that it is going to use sockets to interoperate between the client and the server. It is not ideal. We have done some work to detect that the transport is intra VM, but it has not really proven any faster. I am sure that there is more I can do, if the deployer is willing to declare and guarantee the hierarchy of classloaders. Future work that...

The config file, shows altrmi being used to publish (automatically) a suitable service as is. In the config file, the name to publish as is also being set. Thus two versions of the same thing could easily be published. I know this works with servlets as I have used it with the Sevak/Jo! server as part of the www.enterpriseobjectbroker.org project.

Is there a JNDI-enabled service manager that additionally exposes its blocks via JNDI? It is certainly a common case that a application would want to access a block e.g. from a web app but not only and that would be a good case for a general mechanism not a project-specific one, or?
Not yet. It is quite controvercial for Avalon people to embrace JNDI is such an outright fashion. It runs against a few of our design ideals.

The special case where I have the problem is for example a web service using Axis. Axis requires a servlet container such as Tomcat or Jetty. So I do not really have a case where a servlet can contact a remote server but the web service should be a component of my server. Ok so I use the Sevak block in my server and then have to either communicate with the other component this web service implementation depends on via Sockets, RMI etc. or have a mechanism to get a object-reference via JNDI. This way Phoenix is used quasi as a web service hosting environment and I find that exciting enough to try to find a general solution to this problem! :-)
If you don't need multi language interoperability, AltRMI is what you want.

As it happens Vinay (congrats on recent marriage dude), plans to do some thinking that allows AltRMI to be WDSL compatible soon.

Regards,

- Paul


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



Reply via email to