T - the type of listenerpublic class ServletListenerRegistrationBean<T extends EventListener> extends RegistrationBean
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:
 ServletContextAttributeListenerServletRequestListenerServletRequestAttributeListenerHttpSessionAttributeListenerHttpSessionListenerServletContextListener| Constructor and Description | 
|---|
| ServletListenerRegistrationBean()Create a new  ServletListenerRegistrationBeaninstance. | 
| ServletListenerRegistrationBean(T listener)Create a new  ServletListenerRegistrationBeaninstance. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected String | getDescription()Return a description of the registration. | 
| T | getListener()Return the listener to be registered. | 
| static Set<Class<?>> | getSupportedTypes()Return the supported types for this registration. | 
| static boolean | isSupportedType(EventListener listener)Returns  trueif the specified listener is one of the supported types. | 
| protected void | register(String description,
        javax.servlet.ServletContext servletContext)Register this bean with the servlet context. | 
| void | setListener(T listener)Set the listener that will be registered. | 
getOrder, isEnabled, onStartup, setEnabled, setOrderpublic ServletListenerRegistrationBean()
ServletListenerRegistrationBean instance.public ServletListenerRegistrationBean(T listener)
ServletListenerRegistrationBean instance.listener - the listener to registerpublic void setListener(T listener)
listener - the listener to registerpublic T getListener()
protected String getDescription()
RegistrationBeangetDescription in class RegistrationBeanprotected void register(String description, javax.servlet.ServletContext servletContext)
RegistrationBeanregister in class RegistrationBeandescription - a description of the item being registeredservletContext - the servlet contextpublic static boolean isSupportedType(EventListener listener)
true if the specified listener is one of the supported types.listener - the listener to testCopyright © 2020 Pivotal Software, Inc.. All rights reserved.