Java Code Examples for org.springframework.boot.web.servlet.ServletListenerRegistrationBean#setEnabled()

The following examples show how to use org.springframework.boot.web.servlet.ServletListenerRegistrationBean#setEnabled() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CasConfiguration.java    From taoshop with Apache License 2.0 5 votes vote down vote up
/**
 * 单点登出监听器
 * @return
 */
@Bean
public ServletListenerRegistrationBean servletListenerRegistrationBean() {
    ServletListenerRegistrationBean registrationBean = new ServletListenerRegistrationBean();
    registrationBean.setListener(new SingleSignOutHttpSessionListener());
    registrationBean.setEnabled(true);
    return registrationBean;
}
 
Example 2
Source File: CasCustomConfig.java    From CAS with Apache License 2.0 5 votes vote down vote up
@Bean
public ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> singleSignOutHttpSessionListener() {
    ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> listener = new ServletListenerRegistrationBean<SingleSignOutHttpSessionListener>();
    listener.setEnabled(casEnabled);
    listener.setListener(new SingleSignOutHttpSessionListener());
    listener.setOrder(1);
    return listener;
}
 
Example 3
Source File: CasCustomConfig.java    From CAS with Apache License 2.0 5 votes vote down vote up
@Bean
public ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> singleSignOutHttpSessionListener() {
    ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> listener = new ServletListenerRegistrationBean<SingleSignOutHttpSessionListener>();
    listener.setEnabled(casEnabled);
    listener.setListener(new SingleSignOutHttpSessionListener());
    listener.setOrder(1);
    return listener;
}
 
Example 4
Source File: CasCustomConfig.java    From CAS with Apache License 2.0 5 votes vote down vote up
@Bean
public ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> singleSignOutHttpSessionListener() {
    ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> listener = new ServletListenerRegistrationBean<SingleSignOutHttpSessionListener>();
    listener.setEnabled(casEnabled);
    listener.setListener(new SingleSignOutHttpSessionListener());
    listener.setOrder(1);
    return listener;
}
 
Example 5
Source File: ShiroConfiguration.java    From springboot-shiro-cas-mybatis with MIT License 5 votes vote down vote up
/**
 * 注册单点登出的listener
 * 
 * @return
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
@Bean
public ServletListenerRegistrationBean<?> singleSignOutHttpSessionListener() {
	ServletListenerRegistrationBean bean = new ServletListenerRegistrationBean();
	bean.setListener(new SingleSignOutHttpSessionListener());
	bean.setEnabled(true);
	return bean;
}
 
Example 6
Source File: CasConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
/**
 *  For single point logout
 */
@Bean
public ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> singleSignOutHttpSessionListener() {
    ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> listener = new ServletListenerRegistrationBean<>();
    listener.setEnabled(true);
    listener.setListener(new SingleSignOutHttpSessionListener());
    listener.setOrder(1);
    return listener;
}
 
Example 7
Source File: CasConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
/**
 *  For single point logout
 */
@Bean
public ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> singleSignOutHttpSessionListener() {
    ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> listener = new ServletListenerRegistrationBean<>();
    listener.setEnabled(true);
    listener.setListener(new SingleSignOutHttpSessionListener());
    listener.setOrder(1);
    return listener;
}
 
Example 8
Source File: CasConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
/**
 *  For single point logout
 */
@Bean
public ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> singleSignOutHttpSessionListener() {
    ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> listener = new ServletListenerRegistrationBean<>();
    listener.setEnabled(true);
    listener.setListener(new SingleSignOutHttpSessionListener());
    listener.setOrder(1);
    return listener;
}
 
Example 9
Source File: CasConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
/**
 *  For single point logout
 */
@Bean
public ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> singleSignOutHttpSessionListener() {
    ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> listener = new ServletListenerRegistrationBean<>();
    listener.setEnabled(true);
    listener.setListener(new SingleSignOutHttpSessionListener());
    listener.setOrder(1);
    return listener;
}
 
Example 10
Source File: CasConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
/**
 *  For single point logout
 */
@Bean
public ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> singleSignOutHttpSessionListener() {
    ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> listener = new ServletListenerRegistrationBean<>();
    listener.setEnabled(true);
    listener.setListener(new SingleSignOutHttpSessionListener());
    listener.setOrder(1);
    return listener;
}
 
Example 11
Source File: JavaMelodyAutoConfiguration.java    From javamelody with Apache License 2.0 5 votes vote down vote up
/**
 * Registers the JavaMelody {@link SessionListener}.
 * @param servletContext ServletContext
 * @return ServletListenerRegistrationBean
 */
@Bean
public ServletListenerRegistrationBean<EventListener> monitoringSessionListener(
		ServletContext servletContext) {
	final ServletListenerRegistrationBean<EventListener> servletListenerRegistrationBean = new ServletListenerRegistrationBean<>(
			new SessionListener());
	if (servletContext.getFilterRegistration("javamelody") != null) {
		// if webapp deployed as war in a container with MonitoringFilter and SessionListener already added by web-fragment.xml,
		// do not add again
		servletListenerRegistrationBean.setEnabled(false);
	}
	return servletListenerRegistrationBean;
}