org.springframework.boot.web.servlet

Class ServletListenerRegistrationBean<T extends EventListener>

    • Constructor Detail

      • ServletListenerRegistrationBean

        public ServletListenerRegistrationBean(T listener)
        Create a new ServletListenerRegistrationBean instance.
        Parameters:
        listener - the listener to register
    • Method Detail

      • setListener

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

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

        protected String getDescription()
        Description copied from class: RegistrationBean
        Return a description of the registration. For example "Servlet resourceServlet"
        Specified by:
        getDescription in class RegistrationBean
        Returns:
        a description of the registration
      • register

        protected void register(String description,
                                ServletContext servletContext)
        Description copied from class: RegistrationBean
        Register this bean with the servlet context.
        Specified by:
        register in class RegistrationBean
        Parameters:
        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.
        Parameters:
        listener - the listener to test
        Returns:
        if the listener is of a supported type
      • getSupportedTypes

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