public class ServletRegistry extends Object
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 ableModifier and Type | Field and Description |
---|---|
protected org.osgi.framework.Bundle |
bundle
The bundle owning this class
|
protected Map<String,BundleHttpContext> |
contexts
The registered HttpContext mapped to the servlet path.
|
protected List<FilterSetDescriptor> |
filters |
protected Map<String,List<ResourcesDescriptor>> |
resources
Store resources contributed from external bundles to servlets.
|
protected org.osgi.service.http.HttpService |
service
The HttpService instance is injected when the service becomes available by the Activator.
|
static String |
SERVLET_NAME |
protected List<ServletDescriptor> |
servlets
Servlets contributed to the extension points.
|
Modifier and Type | Method and Description |
---|---|
void |
addFilterSet(FilterSetDescriptor filter) |
void |
addResources(ResourcesDescriptor rd) |
void |
addServlet(ServletDescriptor descriptor) |
static void |
dispose() |
FilterSetDescriptor[] |
getFilterSetDescriptors() |
List<FilterSetDescriptor> |
getFiltersFor(String name) |
org.osgi.service.http.HttpService |
getHttpService() |
static ServletRegistry |
getInstance() |
ServletDescriptor |
getServletDescriptor(String name) |
ServletDescriptor[] |
getServletDescriptors() |
void |
initHttpService(org.osgi.service.http.HttpService service)
Called by the service tracker when HttpService is up to configure it with current contributed servlets
|
void |
reloadServlet(ServletDescriptor descriptor) |
void |
removeFilterSet(FilterSetDescriptor filter) |
void |
removeResources(ResourcesDescriptor rd) |
void |
removeServlet(ServletDescriptor descriptor) |
public static final String SERVLET_NAME
protected List<ServletDescriptor> servlets
HttpService
when it becomes
available.protected List<FilterSetDescriptor> filters
protected Map<String,List<ResourcesDescriptor>> resources
protected Map<String,BundleHttpContext> contexts
Resource contributions are injected into the context and reinjected each time the context is restarted.
protected org.osgi.service.http.HttpService service
protected org.osgi.framework.Bundle bundle
public static ServletRegistry getInstance()
public static void dispose()
public ServletDescriptor[] getServletDescriptors()
public FilterSetDescriptor[] getFilterSetDescriptors()
public ServletDescriptor getServletDescriptor(String name)
public List<FilterSetDescriptor> getFiltersFor(String name)
public void initHttpService(org.osgi.service.http.HttpService service) throws javax.servlet.ServletException, org.osgi.service.http.NamespaceException
service
- javax.servlet.ServletException
org.osgi.service.http.NamespaceException
public org.osgi.service.http.HttpService getHttpService()
public void addServlet(ServletDescriptor descriptor) throws javax.servlet.ServletException, org.osgi.service.http.NamespaceException
javax.servlet.ServletException
org.osgi.service.http.NamespaceException
public void removeServlet(ServletDescriptor descriptor)
public void reloadServlet(ServletDescriptor descriptor) throws javax.servlet.ServletException, org.osgi.service.http.NamespaceException
javax.servlet.ServletException
org.osgi.service.http.NamespaceException
public void addFilterSet(FilterSetDescriptor filter)
public void removeFilterSet(FilterSetDescriptor filter)
public void addResources(ResourcesDescriptor rd)
public void removeResources(ResourcesDescriptor rd)
Copyright © 2017 Nuxeo. All rights reserved.