public class DefaultServletModuleManager extends Object implements ServletModuleManager
| Constructor and Description |
|---|
DefaultServletModuleManager(com.atlassian.plugin.event.PluginEventManager pluginEventManager)
|
DefaultServletModuleManager(com.atlassian.plugin.event.PluginEventManager pluginEventManager,
PathMapper servletPathMapper,
PathMapper filterPathMapper)
|
DefaultServletModuleManager(javax.servlet.ServletContext servletContext,
com.atlassian.plugin.event.PluginEventManager pluginEventManager)
Constructor that sets itself in the servlet context for later use in dispatching servlets and filters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFilterModule(ServletFilterModuleDescriptor descriptor)
Register a new filter plugin module.
|
void |
addServlet(Plugin plugin,
String servletName,
javax.servlet.http.HttpServlet servlet,
javax.servlet.ServletContext servletContext)
To be invoked by
PluginServletContextWrapper.addServlet(String, javax.servlet.Servlet). |
void |
addServlet(Plugin plugin,
String servletName,
String className)
|
void |
addServletModule(ServletModuleDescriptor descriptor)
Register a new servlet plugin module.
|
Iterable<javax.servlet.Filter> |
getFilters(FilterLocation location,
String path,
javax.servlet.FilterConfig filterConfig)
Returns the filters that have been registered to filter requests at the specified path matching the location
in the filter stack.
|
Iterable<javax.servlet.Filter> |
getFilters(FilterLocation location,
String path,
javax.servlet.FilterConfig filterConfig,
FilterDispatcherCondition condition)
Returns the filters that have been registered to filter requests at the specified path matching the location
in the filter stack and registered for the specific dispatcher condition.
|
javax.servlet.http.HttpServlet |
getServlet(String path,
javax.servlet.ServletConfig servletConfig)
Return an instance of the HttpServlet that should be used to serve content matching the provided url path.
|
void |
onPluginDisabled(com.atlassian.plugin.event.events.PluginDisabledEvent event)
Call the plugins servlet context listeners contextDestroyed methods and cleanup any servlet contexts that are associated with
the plugin that was disabled.
|
void |
onPluginFrameworkBeforeShutdown(com.atlassian.plugin.event.events.PluginFrameworkShuttingDownEvent event) |
void |
onPluginFrameworkShutdown(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event)
Deprecated.
|
void |
onPluginFrameworkShutdownEvent(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event) |
void |
onPluginFrameworkStartingEvent(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event) |
void |
removeFilterModule(ServletFilterModuleDescriptor descriptor)
Remove a previously registered filter plugin module.
|
void |
removeServletModule(ServletModuleDescriptor descriptor)
Remove a previously registered servlet plugin module.
|
public DefaultServletModuleManager(javax.servlet.ServletContext servletContext,
com.atlassian.plugin.event.PluginEventManager pluginEventManager)
servletContext - The servlet context to store itself inpluginEventManager - The plugin event manager@Deprecated public DefaultServletModuleManager(com.atlassian.plugin.event.PluginEventManager pluginEventManager)
DefaultServletModuleManager(com.atlassian.plugin.event.PluginEventManager,
com.atlassian.plugin.servlet.util.PathMapper, com.atlassian.plugin.servlet.util.PathMapper, FilterFactory) instead. Since
v3.2.20.ServletContextServletModuleManagerAccessor.setServletModuleManager(javax.servlet.ServletContext,
ServletModuleManager) yourself if you don't extend the dispatching servlet and filter classes to provide the servlet module
manager instance.pluginEventManager - The plugin event manager@Deprecated public DefaultServletModuleManager(com.atlassian.plugin.event.PluginEventManager pluginEventManager, PathMapper servletPathMapper, PathMapper filterPathMapper)
DefaultServletModuleManager(com.atlassian.plugin.event.PluginEventManager,
com.atlassian.plugin.servlet.util.PathMapper, com.atlassian.plugin.servlet.util.PathMapper, FilterFactory) instead. Since
v3.2.20.ServletContextServletModuleManagerAccessor.setServletModuleManager(javax.servlet.ServletContext,
ServletModuleManager) yourself if you don't extend the dispatching servlet and filter classes to provide the servlet module
manager instance.pluginEventManager - The plugin event managerservletPathMapper - The path mapper used for mapping servlets to pathsfilterPathMapper - The path mapper used for mapping filters to pathspublic void addServletModule(ServletModuleDescriptor descriptor)
ServletModuleManageraddServletModule in interface ServletModuleManagerdescriptor - Details of what the servlet class is and the path it should serve.public javax.servlet.http.HttpServlet getServlet(String path, javax.servlet.ServletConfig servletConfig) throws javax.servlet.ServletException
ServletModuleManagergetServlet in interface ServletModuleManagerpath - Path of the incoming request to serve.servletConfig - ServletConfig given to the delegating servlet.javax.servlet.ServletException - Thrown if there is a problem initializing the servlet to be returned.public void removeServletModule(ServletModuleDescriptor descriptor)
ServletModuleManagerremoveServletModule in interface ServletModuleManagerdescriptor - Details of what servlet module to remove.public void addFilterModule(ServletFilterModuleDescriptor descriptor)
ServletModuleManageraddFilterModule in interface ServletModuleManagerdescriptor - Details of what the filter class is and the path it should serve.public Iterable<javax.servlet.Filter> getFilters(FilterLocation location, String path, javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
ServletModuleManagergetFilters in interface ServletModuleManagerlocation - Place in the applications filter stack the filters should be applied.path - Path of the incoming request to filter.filterConfig - FilterConfig given to the delegating filter.javax.servlet.ServletException - Thrown if there is a problem initializing one of the filters to apply.public Iterable<javax.servlet.Filter> getFilters(FilterLocation location, String path, javax.servlet.FilterConfig filterConfig, FilterDispatcherCondition condition) throws javax.servlet.ServletException
ServletModuleManagergetFilters in interface ServletModuleManagerlocation - Place in the applications filter stack the filters should be applied.path - Path of the incoming request to filter.filterConfig - FilterConfig given to the delegating filter.condition - The dispatcher tag that filters have been registered to. Cannot be null.javax.servlet.ServletException - Thrown if there is a problem initializing one of the filters to apply.public void removeFilterModule(ServletFilterModuleDescriptor descriptor)
ServletModuleManagerremoveFilterModule in interface ServletModuleManagerdescriptor - Details of what filter module to remove.public void addServlet(Plugin plugin, String servletName, String className)
ServletModuleManagerPluginServletContextWrapper.addServlet(String, String) and
PluginServletContextWrapper.addServlet(String, Class).
Module containing the servlet will use servletName for:
className will be instantiated and initialised on first use.addServlet in interface ServletModuleManagerplugin - mandatoryservletName - mandatoryclassName - mandatorypublic void addServlet(Plugin plugin, String servletName, javax.servlet.http.HttpServlet servlet, javax.servlet.ServletContext servletContext)
ServletModuleManagerPluginServletContextWrapper.addServlet(String, javax.servlet.Servlet).
Module containing the servlet will use servletName for:
servlet will be initialised on first use.addServlet in interface ServletModuleManagerplugin - mandatoryservletName - mandatoryservlet - mandatoryservletContext - mandatorypublic void onPluginFrameworkStartingEvent(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event)
public void onPluginFrameworkShutdownEvent(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event)
public void onPluginDisabled(com.atlassian.plugin.event.events.PluginDisabledEvent event)
public void onPluginFrameworkBeforeShutdown(com.atlassian.plugin.event.events.PluginFrameworkShuttingDownEvent event)
@Deprecated public void onPluginFrameworkShutdown(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event)
Copyright © 2015 Atlassian. All rights reserved.