You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Paul Hammant <Pa...@yahoo.com> on 2002/10/09 08:34:18 UTC

ServiceManager

Daniel Krieg is going to enhance the Sevak block (or an optional 
extension of it) to register services retrieved from ServiceManager in 
JNDI for the use of WAR file webapps in Catalina in the same JVM.

Unfortunately there is a catch-22.  The assembler must declare services 
in xinfo and the developer must use lookup on ServiceManager to get the 
service in order to register it in JNDI.  If we had a list() method on 
ServiceManager then we would be in position where we could code a block 
that speculatively reads blocks and places them in JNDI.

The other choice would be to declare service names in config, get then 
via configure() then (out of order) retrieve then from ServiceManager.

Thoughts?

- Paul




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ServiceManager

Posted by Stephen McConnell <mc...@apache.org>.

Paul Hammant wrote:

> Daniel Krieg is going to enhance the Sevak block (or an optional 
> extension of it) to register services retrieved from ServiceManager in 
> JNDI for the use of WAR file webapps in Catalina in the same JVM.
>
> Unfortunately there is a catch-22.  The assembler must declare 
> services in xinfo and the developer must use lookup on ServiceManager 
> to get the service in order to register it in JNDI.  If we had a 
> list() method on ServiceManager then we would be in position where we 
> could code a block that speculatively reads blocks and places them in 
> JNDI.
>
> The other choice would be to declare service names in config, get then 
> via configure() then (out of order) retrieve then from ServiceManager.
>
> Thoughts? 


What I typically do is use a component to setup the web application 
context - the component basically declares the dependecies it needs (on 
behalf of the web application), then resolves these services and 
provides them to the we app.  Providing them to the web app could be 
publishing the respective services into a JNDI context using roles names 
(that the component has declared).  Over in servlet land, a 
corresponding set of declarations would be required to declare to tomcat 
that these services are available via JNDI (inside the web.xml file).

Cheers, Steve.

>
>
> - Paul
>
>
>
>
> -- 
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>
>
>

-- 

Stephen J. McConnell

OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ServiceManager

Posted by Peter Donald <pe...@apache.org>.
On Wed, 9 Oct 2002 16:34, Paul Hammant wrote:
> Daniel Krieg is going to enhance the Sevak block (or an optional
> extension of it) to register services retrieved from ServiceManager in
> JNDI for the use of WAR file webapps in Catalina in the same JVM.

very kool.

> Unfortunately there is a catch-22.  The assembler must declare services
> in xinfo and the developer must use lookup on ServiceManager to get the
> service in order to register it in JNDI.  If we had a list() method on
> ServiceManager then we would be in position where we could code a block
> that speculatively reads blocks and places them in JNDI.
>
> The other choice would be to declare service names in config, get then
> via configure() then (out of order) retrieve then from ServiceManager.
>
> Thoughts?

Another choice would be to place an object in the context that exposed  all 
the services. Ideally any block that needed this object would declare a 
dependency on it and could then use it to expose all needed stuff.

However another option would be to allow declaration of untyped services. 
Essentially the service could accept "services" of any type and not enforce 
any particular work interface. This sorta sounds like a good way to go but I 
am not sure if I like the notion of un-typed "services"

-- 
Cheers,

Peter Donald
-----------------------------------------------
"Only two things are infinite, the universe and 
human stupidity, and I'm not sure about the 
former." -Albert Einstein 
----------------------------------------------- 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ServiceManager

Posted by Mircea Toma <mi...@apache.org>.
> The other choice would be to declare service names in config,
> get then
> via configure() then (out of order) retrieve then from ServiceManager.

How about having a JNDISystemManager (SystemManager ala Phoenix) that will
register the components in the JNDI tree?

Mircea


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ServiceManager

Posted by Peter Donald <pe...@apache.org>.
On Wed, 9 Oct 2002 19:32, Leo Sutic wrote:
> Isn't this the problem the Map/Array dependency stuff solved?
>
> I think Peter D specifically mentioned something very similar to this
> in that thread.

Similar. However I was more thinking along the lines of "client" objects and 
"brokers". So if your Block implemented Soapable then it could be exported by 
SoapServer (or whatever). However all the objects still have to implement a 
work interface of some sort when placed as a dependency. In JNDIs case there 
is no work interface ;/

-- 
Cheers,

Peter Donald
----------------------------------------------
Money is how people with no talent keep score.
---------------------------------------------- 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ServiceManager

Posted by Peter Royal <pr...@apache.org>.
On Wednesday, October 9, 2002, at 05:32  AM, Leo Sutic wrote:
> Isn't this the problem the Map/Array dependency stuff solved?
>
> I think Peter D specifically mentioned something very similar to this
> in that thread.

I think the Map/Array stuff is when you need >1 items that implement a 
specific role. Paul needs to query the ServiceManager to see what 
different roles it contains items for (be them single impls, maps, or 
arrays) to publish via JNDI.
-pete
-- 
peter royal -> proyal@apache.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: ServiceManager

Posted by Leo Sutic <le...@inspireinfrastructure.com>.
Isn't this the problem the Map/Array dependency stuff solved?

I think Peter D specifically mentioned something very similar to this
in that thread.

/LS

> From: Paul Hammant [mailto:Paul_Hammant@yahoo.com] 
> 
> Daniel Krieg is going to enhance the Sevak block (or an optional 
> extension of it) to register services retrieved from 
> ServiceManager in 
> JNDI for the use of WAR file webapps in Catalina in the same JVM.
> 
> Unfortunately there is a catch-22.  The assembler must 
> declare services 
> in xinfo and the developer must use lookup on ServiceManager 
> to get the 
> service in order to register it in JNDI.  If we had a list() 
> method on 
> ServiceManager then we would be in position where we could 
> code a block 
> that speculatively reads blocks and places them in JNDI.
> 
> The other choice would be to declare service names in config, 
> get then 
> via configure() then (out of order) retrieve then from ServiceManager.
> 
> Thoughts?
> 
> - Paul
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:avalon-dev-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ServiceManager

Posted by Daniel Krieg <dk...@kc.rr.com>.
> > Which is not a problem ,except that there is no list() method for
> > Sevak to read them as named
> > Objects and shove them into the JNDI tree as objects.
>
> But Sevak would put the ServiceManager into JNDI, not the individual
> services themselves...
I was considering placing each service in individually, this way, Webapps do
not need to ...

Context ctx = new InitialContext( );
ServiceManager sm =
(ServiceManager)ctx.lookup("java:comp/env/service/ServiceManager");
MyService ms = (MyService)sm.lookup(MyService.ROLE);

Rather just...

Context ctx = new InitialContext( );
MyService ms = (MyService)ctx.lookup("java:comp/env/service/MyService");

>
> > All in all, I can't help feeling that the optimizing RMI / AltRMI
> > route is cleaner.  With
> > autopublish for AltRMI in Cornerstone, half the work is done already.
>
> it is :)
I have never used AltRMI.  What is autopublish?  I have been working on
binding a Service into JNDI within Catalina and have been encountering
problems.  The approach I have been taking is to have the server bind the
Service into JNDI and use a custom ObjectFactory that can lookup that
binding and return it.  The Web app calls for
"java:comp/env/service/MyService" for example.  The ObjectFactory is passed
a property specifying the actual binding, performs a lookup and returns it.
The problem I am currently having is that the ObjectFactory is not locating
the binding.  However, something I have considered is binding the Service
object into another NamingSystem (RMIRegistry or something similar) and have
the ObjectFactory pull the service from there.

Any thoughts?


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ServiceManager

Posted by Peter Royal <pr...@apache.org>.
On Thursday, October 10, 2002, at 10:46  AM, Paul Hammant wrote:
>> I was thinking that the Sevak block would declare dependencies on any
>> blocks that were needed by contained webapps.. but that would require
>> replacing sevak's xinfo...
>
> Which is not a problem ,except that there is no list() method for 
> Sevak to read them as named
> Objects and shove them into the JNDI tree as objects.

But Sevak would put the ServiceManager into JNDI, not the individual 
services themselves...

> All in all, I can't help feeling that the optimizing RMI / AltRMI 
> route is cleaner.  With
> autopublish for AltRMI in Cornerstone, half the work is done already.

it is :)

-pete
-- 
peter royal -> proyal@apache.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ServiceManager

Posted by Paul Hammant <pa...@yahoo.com>.
> I was thinking that the Sevak block would declare dependencies on any 
> blocks that were needed by contained webapps.. but that would require 
> replacing sevak's xinfo...

Which is not a problem ,except that there is no list() method for Sevak to read them as named
Objects and shove them into the JNDI tree as objects.

All in all, I can't help feeling that the optimizing RMI / AltRMI route is cleaner.  With
autopublish for AltRMI in Cornerstone, half the work is done already.

I'll, away for a day of so but I might work on the 'optimizing' bit of AltRMI when i get back. 
EOB needs it too, but then EOB uses Sevak...

-ph


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ServiceManager

Posted by Peter Royal <pr...@apache.org>.
On Wednesday, October 9, 2002, at 06:29  PM, Peter Donald wrote:
>> Why not just register the ServiceManager itself in JNDI? Would that 
>> not
>> be arguably more useful? If you were setting up a container hierarchy
>> inside of your servlet, you could set it to be the parent
>> ServiceManager! :)
>
> Mainly because the Phoenix ServiceManagers only contains the services 
> that the
> block has declared dependendencies on. ie It is impossible to break 
> out of
> the box via that route.

I was thinking that the Sevak block would declare dependencies on any 
blocks that were needed by contained webapps.. but that would require 
replacing sevak's xinfo...
-pete
-- 
peter royal -> proyal@apache.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ServiceManager

Posted by Peter Donald <pe...@apache.org>.
On Wed, 9 Oct 2002 21:08, Peter Royal wrote:
> On Wednesday, October 9, 2002, at 02:34  AM, Paul Hammant wrote:
> > Daniel Krieg is going to enhance the Sevak block (or an optional
> > extension of it) to register services retrieved from ServiceManager in
> > JNDI for the use of WAR file webapps in Catalina in the same JVM.
>
> Why not just register the ServiceManager itself in JNDI? Would that not
> be arguably more useful? If you were setting up a container hierarchy
> inside of your servlet, you could set it to be the parent
> ServiceManager! :)

Mainly because the Phoenix ServiceManagers only contains the services that the 
block has declared dependendencies on. ie It is impossible to break out of 
the box via that route.

-- 
Cheers,

Peter Donald
----------------------------------------
"Liberty means responsibility. That is 
      why most men dread it." - Locke
---------------------------------------- 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ServiceManager

Posted by Peter Royal <pr...@apache.org>.
On Wednesday, October 9, 2002, at 02:34  AM, Paul Hammant wrote:
> Daniel Krieg is going to enhance the Sevak block (or an optional 
> extension of it) to register services retrieved from ServiceManager in 
> JNDI for the use of WAR file webapps in Catalina in the same JVM.
>

Why not just register the ServiceManager itself in JNDI? Would that not 
be arguably more useful? If you were setting up a container hierarchy 
inside of your servlet, you could set it to be the parent 
ServiceManager! :)
-pete

-- 
peter royal -> proyal@apache.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>