felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raymond Auge <raymond.a...@liferay.com>
Subject Re: Get a list of paths of registered servlets
Date Wed, 01 Jun 2016 21:43:57 GMT
Also, the runtime API DOES include information about the legacy HttpService
registrations, the service id numbering increments downward from -1
indicating they aren't real services.

that's the only difference.

- Ray

On Wed, Jun 1, 2016 at 5:40 PM, Neil Bartlett <njbartlett@gmail.com> wrote:

> 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 <marcel.offermans@luminis.nl>
> 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 (raymond.auge@liferay.com)
> 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 <
> david.daniel.1979@gmail.com>
> > 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)
>
>


-- 
*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)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message