View Javadoc
1   package com.atlassian.plugin.spring;
2   
3   import com.atlassian.plugin.event.PluginEventManager;
4   import com.atlassian.plugin.servlet.DefaultServletModuleManager;
5   import com.atlassian.plugin.servlet.ServletModuleManager;
6   import com.atlassian.plugin.servlet.util.ServletContextServletModuleManagerAccessor;
7   import org.springframework.web.context.ServletContextAware;
8   
9   import javax.servlet.ServletContext;
10  
11  /**
12   * A {@link ServletModuleManager} that has a {@link ServletContext} automatically injected
13   */
14  public class SpringServletModuleManager extends DefaultServletModuleManager implements ServletContextAware {
15      // ------------------------------------------------------------------------------------------------------- Constants
16      // ------------------------------------------------------------------------------------------------- Type Properties
17      // ---------------------------------------------------------------------------------------------------- Dependencies
18      // ---------------------------------------------------------------------------------------------------- Constructors
19      public SpringServletModuleManager(final PluginEventManager pluginEventManager) {
20          super(pluginEventManager);
21      }
22  
23      // ----------------------------------------------------------------------------------------------- Interface Methods
24      // -------------------------------------------------------------------------------------------------- Public Methods
25      // -------------------------------------------------------------------------------------- Basic Accessors / Mutators
26      public void setServletContext(final ServletContext servletContext) {
27          ServletContextServletModuleManagerAccessor.setServletModuleManager(servletContext, this);
28      }
29  }