Well, you CAN atomically find out whether the name you want to register is 
already registered: just try to do it, and catch the NamespaceException.

Neil


> On 1 Jun 2016, at 22:37, Marcel Offermans <[email protected]> wrote:
> 
> That only helps him if he uses the whiteboard API. If he directly talks to 
> HttpService it probably won’t work.
> 
> Another problem is that you probably can’t do this as an atomic operation so 
> after you’ve checked, someone else can still beat you to it.
> 
> That said I don’t have a great solution to your problem beyond keeping track 
> of this yourself and delegating the registration of the servlets to a service 
> you design (which can then atomically do such a check). Again, that only 
> works if everything then goes through your service.
> 
> Greetings, Marcel
> 
> On 1 June 2016 at 22:56:01, Raymond Auge ([email protected]) wrote:
> 
> The Http Whiteboard API contains a runtime introspection API which returns  
> DTOs of what's registered.  
> 
> look for a service registered under interface:  
> 
> org.osgi.service.http.runtime.HttpServiceRuntime  
> 
> 
> - Ray  
> 
> On Wed, Jun 1, 2016 at 4:24 PM, David Daniel <[email protected]>  
> wrote:  
> 
>> Is it possible to find out what servlets have been registered with the  
>> httpservice. I am dynamically registering servlets and want to verify that  
>> a servlet has not already been registered with the same path. Is there a  
>> way to query the httpservice for all servlet paths that are registered,  
>> should I be keeping that information elsewhere or is there a tracker of  
>> some sort.  
>> 
>> Thanks for any help,  
>> David  
>> 
> 
> 
> 
> --  
> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>  
> (@rotty3000)  
> Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>  
> (@Liferay)  
> Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)  


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to