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  {
16      // ------------------------------------------------------------------------------------------------------- Constants
17      // ------------------------------------------------------------------------------------------------- Type Properties
18      // ---------------------------------------------------------------------------------------------------- Dependencies
19      // ---------------------------------------------------------------------------------------------------- Constructors
20      public SpringServletModuleManager(final PluginEventManager pluginEventManager)
21      {
22          super(pluginEventManager);
23      }
24  
25      // ----------------------------------------------------------------------------------------------- Interface Methods
26      // -------------------------------------------------------------------------------------------------- Public Methods
27      // -------------------------------------------------------------------------------------- Basic Accessors / Mutators
28      public void setServletContext(final ServletContext servletContext)
29      {
30          ServletContextServletModuleManagerAccessor.setServletModuleManager(servletContext, this);
31      }
32  }