|
|
@ -30,6 +30,8 @@ import javax.servlet.ServletRequestListener;
|
|
|
|
import javax.servlet.http.HttpSessionAttributeListener;
|
|
|
|
import javax.servlet.http.HttpSessionAttributeListener;
|
|
|
|
import javax.servlet.http.HttpSessionListener;
|
|
|
|
import javax.servlet.http.HttpSessionListener;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.logging.Log;
|
|
|
|
|
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
import org.springframework.util.ClassUtils;
|
|
|
|
import org.springframework.util.ClassUtils;
|
|
|
|
|
|
|
|
|
|
|
@ -55,6 +57,8 @@ import org.springframework.util.ClassUtils;
|
|
|
|
public class ServletListenerRegistrationBean<T extends EventListener> extends
|
|
|
|
public class ServletListenerRegistrationBean<T extends EventListener> extends
|
|
|
|
RegistrationBean {
|
|
|
|
RegistrationBean {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static Log logger = LogFactory.getLog(ServletListenerRegistrationBean.class);
|
|
|
|
|
|
|
|
|
|
|
|
private static final Set<Class<?>> SUPPORTED_TYPES;
|
|
|
|
private static final Set<Class<?>> SUPPORTED_TYPES;
|
|
|
|
static {
|
|
|
|
static {
|
|
|
|
Set<Class<?>> types = new HashSet<Class<?>>();
|
|
|
|
Set<Class<?>> types = new HashSet<Class<?>>();
|
|
|
@ -97,6 +101,10 @@ public class ServletListenerRegistrationBean<T extends EventListener> extends
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onStartup(ServletContext servletContext) throws ServletException {
|
|
|
|
public void onStartup(ServletContext servletContext) throws ServletException {
|
|
|
|
|
|
|
|
if (!isEnabled()) {
|
|
|
|
|
|
|
|
logger.info("Listener " + this.listener + " was not registered (disabled)");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
servletContext.addListener(this.listener);
|
|
|
|
servletContext.addListener(this.listener);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|