cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emond Papegaaij <e.papega...@student.utwente.nl>
Subject Re: Accessing services
Date Tue, 06 Jul 2004 16:40:18 GMT
<cut: how to access a service from:>
> > - custom java objects
> 
> Write your own method? But:
> 
> You should never throw a component thru other objects because of closing it
> correctly can be a problem!
>  
> The best way ist to get the component, fetch all datas required and then
> return it immediately after that. Only the required datas should be used as
> arguments for other objects becuase you can fall into troubles if you're
> using Poolable or ThreadSafe and not returning the component correctly!   

The problem is I can't find a way to access the ServiceManager from a custom 
class. The only way I can find is to make the object a Serviceable itself.

I've got a Connector class that connects to a server over SOAP. This class 
needs to fetch the username and password from the current session. However, 
to access the Session object I need the SessionManager. This manager is 
registered in the root ServiceManager, but I just can't find a way to get to 
this ServiceManager.

By the way, I just discovered that XSPGenerator has a manager field. I don't 
need access from the sitemap anymore, and the flow methods you gave seem to 
do what I need. Thanks.

Best regards,
Emond Papegaaij

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message