类 ServletListenerRegistrationBean<T extends EventListener>

java.lang.Object
org.springframework.boot.web.servlet.RegistrationBean
org.springframework.boot.web.servlet.ServletListenerRegistrationBean<T>
类型参数:
T - the type of listener
所有已实现的接口:
ServletContextInitializer, Ordered

public class ServletListenerRegistrationBean<T extends EventListener> extends RegistrationBean
A ServletContextInitializer to register EventListeners in a Servlet 3.0+ container. Similar to the registration features provided by ServletContext but with a Spring Bean friendly design. This bean can be used to register the following types of listener:
从以下版本开始:
1.4.0
作者:
Dave Syer, Phillip Webb
  • 构造器详细资料

  • 方法详细资料

    • setListener

      public void setListener(T listener)
      Set the listener that will be registered.
      参数:
      listener - the listener to register
    • getListener

      public T getListener()
      Return the listener to be registered.
      返回:
      the listener to be registered
    • getDescription

      protected String getDescription()
      从类复制的说明: RegistrationBean
      Return a description of the registration. For example "Servlet resourceServlet"
      指定者:
      getDescription 在类中 RegistrationBean
      返回:
      a description of the registration
    • register

      protected void register(String description, ServletContext servletContext)
      从类复制的说明: RegistrationBean
      Register this bean with the servlet context.
      指定者:
      register 在类中 RegistrationBean
      参数:
      description - a description of the item being registered
      servletContext - the servlet context
    • isSupportedType

      public static boolean isSupportedType(EventListener listener)
      Returns true if the specified listener is one of the supported types.
      参数:
      listener - the listener to test
      返回:
      if the listener is of a supported type
    • getSupportedTypes

      public static Set<Class<?>> getSupportedTypes()
      Return the supported types for this registration.
      返回:
      the supported types