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
FieldsModifier and TypeFieldDescriptionprotected org.osgi.framework.BundleThe 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.HttpServiceThe HttpService instance is injected when the service becomes available by the Activator.static final Stringprotected List<ServletDescriptor>Servlets contributed to the extension points. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFilterSet(FilterSetDescriptor filter) voidvoidaddServlet(ServletDescriptor descriptor) static voiddispose()getFiltersFor(String name) org.osgi.service.http.HttpServicestatic ServletRegistrygetServletDescriptor(String name) voidinitHttpService(org.osgi.service.http.HttpService service) Called by the service tracker when HttpService is up to configure it with current contributed servletsvoidreloadServlet(ServletDescriptor descriptor) voidremoveFilterSet(FilterSetDescriptor filter) voidvoidremoveServlet(ServletDescriptor descriptor)
-
Field Details
-
SERVLET_NAME
-
servlets
Servlets contributed to the extension points. Servlets are contributed to theHttpServicewhen 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.ServletExceptionorg.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.ServletExceptionorg.osgi.service.http.NamespaceException
-
removeServlet
-
reloadServlet
public void reloadServlet(ServletDescriptor descriptor) throws javax.servlet.ServletException, org.osgi.service.http.NamespaceException - Throws:
javax.servlet.ServletExceptionorg.osgi.service.http.NamespaceException
-
addFilterSet
-
removeFilterSet
-
addResources
-
removeResources
-