|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.boot.context.embedded.RegistrationBean
org.springframework.boot.context.embedded.ServletListenerRegistrationBean<T>
T - the type of listenerpublic class ServletListenerRegistrationBean<T extends EventListener>
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:
ServletContextAttributeListenerServletRequestListenerServletRequestAttributeListenerHttpSessionAttributeListenerHttpSessionListenerServletContextListener
| Constructor Summary | |
|---|---|
ServletListenerRegistrationBean()
Create a new ServletListenerRegistrationBean instance. |
|
ServletListenerRegistrationBean(T listener)
Create a new ServletListenerRegistrationBean instance. |
|
| Method Summary | |
|---|---|
T |
getListener()
|
static boolean |
isSupportedType(EventListener listener)
Returns true if the specified listener is one of the supported types. |
void |
onStartup(javax.servlet.ServletContext servletContext)
Configure the given ServletContext with any servlets, filters, listeners
context-params and attributes necessary for initialization. |
void |
setListener(T listener)
Set the listener that will be registered. |
| Methods inherited from class org.springframework.boot.context.embedded.RegistrationBean |
|---|
addInitParameter, configure, getInitParameters, getOrDeduceName, isAsyncSupported, setAsyncSupported, setInitParameters, setName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ServletListenerRegistrationBean()
ServletListenerRegistrationBean instance.
public ServletListenerRegistrationBean(T listener)
ServletListenerRegistrationBean instance.
listener - the listener to register| Method Detail |
|---|
public void setListener(T listener)
listener - the listener to register
public void onStartup(javax.servlet.ServletContext servletContext)
throws javax.servlet.ServletException
ServletContextInitializerServletContext with any servlets, filters, listeners
context-params and attributes necessary for initialization.
servletContext - the ServletContext to initialize
javax.servlet.ServletException - if any call against the given ServletContext
throws a ServletExceptionpublic T getListener()
public static boolean isSupportedType(EventListener listener)
true if the specified listener is one of the supported types.
listener - the listener to test
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||