Class ServletRegistry
java.lang.Object
org.nuxeo.ecm.webengine.jaxrs.servlet.config.ServletRegistry
Handle servlet registration from Nuxeo extension points. This class is a singleton shared by the
Activator
and the ServletRegistryComponent
component. Because we don't have yet a solution to synchronize the
initialization time of the Activator and a Nuxeo component we are using a singleton instance to be able- Author:
- Bogdan Stefanescu
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.osgi.framework.Bundle
The bundle owning this classprotected Map<String,
BundleHttpContext> The registered HttpContext mapped to the servlet path.protected List<FilterSetDescriptor>
protected Map<String,
List<ResourcesDescriptor>> Store resources contributed from external bundles to servlets.protected org.osgi.service.http.HttpService
The HttpService instance is injected when the service becomes available by the Activator.static final String
protected List<ServletDescriptor>
Servlets contributed to the extension points. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFilterSet
(FilterSetDescriptor filter) void
void
addServlet
(ServletDescriptor descriptor) static void
dispose()
getFiltersFor
(String name) org.osgi.service.http.HttpService
static ServletRegistry
getServletDescriptor
(String name) void
initHttpService
(org.osgi.service.http.HttpService service) Called by the service tracker when HttpService is up to configure it with current contributed servletsvoid
reloadServlet
(ServletDescriptor descriptor) void
removeFilterSet
(FilterSetDescriptor filter) void
void
removeServlet
(ServletDescriptor descriptor)
-
Field Details
-
SERVLET_NAME
-
servlets
Servlets contributed to the extension points. Servlets are contributed to theHttpService
when it becomes available. -
filters
-
resources
Store resources contributed from external bundles to servlets. Map the servlet path to the list of contributed resources -
contexts
The registered HttpContext mapped to the servlet path. An HttpContext is created and inserted in this map when its servlet is registered against the HttpService. The context is removed when the servlet is unregsitered.Resource contributions are injected into the context and reinjected each time the context is restarted.
-
service
protected org.osgi.service.http.HttpService serviceThe HttpService instance is injected when the service becomes available by the Activator. -
bundle
protected org.osgi.framework.Bundle bundleThe bundle owning this class
-
-
Method Details
-
getInstance
-
dispose
public static void dispose() -
getServletDescriptors
-
getFilterSetDescriptors
-
getServletDescriptor
-
getFiltersFor
-
initHttpService
public void initHttpService(org.osgi.service.http.HttpService service) throws javax.servlet.ServletException, org.osgi.service.http.NamespaceException Called by the service tracker when HttpService is up to configure it with current contributed servlets- Throws:
javax.servlet.ServletException
org.osgi.service.http.NamespaceException
-
getHttpService
public org.osgi.service.http.HttpService getHttpService() -
addServlet
public void addServlet(ServletDescriptor descriptor) throws javax.servlet.ServletException, org.osgi.service.http.NamespaceException - Throws:
javax.servlet.ServletException
org.osgi.service.http.NamespaceException
-
removeServlet
-
reloadServlet
public void reloadServlet(ServletDescriptor descriptor) throws javax.servlet.ServletException, org.osgi.service.http.NamespaceException - Throws:
javax.servlet.ServletException
org.osgi.service.http.NamespaceException
-
addFilterSet
-
removeFilterSet
-
addResources
-
removeResources
-