View Javadoc

1   package com.atlassian.plugin.servlet.descriptors;
2   
3   import com.atlassian.plugin.descriptors.AbstractModuleDescriptor;
4   import com.atlassian.plugin.hostcontainer.HostContainer;
5   import com.atlassian.plugin.module.HostContainerLegacyAdaptor;
6   import com.atlassian.plugin.module.ModuleFactory;
7   import org.slf4j.Logger;
8   import org.slf4j.LoggerFactory;
9   
10  import javax.servlet.ServletContextListener;
11  
12  /**
13   * Provides a way for plugins to declare {@link ServletContextListener}s so they can be notified when the 
14   * {@link javax.servlet.ServletContext} is created for the plugin.  Implementors need to extend this class and implement the
15   * {#link autowireObject} method.
16   *
17   * @since 2.1.0
18   */
19  public class ServletContextListenerModuleDescriptor extends AbstractModuleDescriptor<ServletContextListener>
20  {
21      protected static final Logger log = LoggerFactory.getLogger(ServletContextListenerModuleDescriptor.class);
22  
23      /**
24       *
25       * @param moduleFactory
26       *
27       * @since 2.5.0
28       */
29      public ServletContextListenerModuleDescriptor(ModuleFactory moduleFactory)
30      {
31          super(moduleFactory);
32      }
33  
34      @Override
35      public ServletContextListener getModule()
36      {
37          return moduleFactory.createModule(moduleClassName, this);
38      }
39  
40  }