More generification to remove last warnings in core package.

This commit is contained in:
Luke Taylor 2009-04-26 10:17:09 +00:00
parent 4f33f4677b
commit 50ac9d3b05
6 changed files with 11 additions and 26 deletions

View File

@ -17,7 +17,6 @@ package org.springframework.security.access.event;
import java.util.List;
import org.springframework.security.access.AccessDecisionManager;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.core.Authentication;

View File

@ -17,8 +17,6 @@ package org.springframework.security.access.event;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
@ -32,14 +30,14 @@ import org.springframework.context.ApplicationListener;
* @author Ben Alex
* @version $Id$
*/
public class LoggerListener implements ApplicationListener {
public class LoggerListener implements ApplicationListener<AbstractAuthorizationEvent> {
//~ Static fields/initializers =====================================================================================
private static final Log logger = LogFactory.getLog(LoggerListener.class);
//~ Methods ========================================================================================================
public void onApplicationEvent(ApplicationEvent event) {
public void onApplicationEvent(AbstractAuthorizationEvent event) {
if (event instanceof AuthenticationCredentialsNotFoundEvent) {
AuthenticationCredentialsNotFoundEvent authEvent = (AuthenticationCredentialsNotFoundEvent) event;

View File

@ -15,10 +15,6 @@
package org.springframework.security.authentication;
import org.springframework.security.core.Authentication;
/**
* Provides a {@link org.springframework.security.core.Authentication#getDetails()} object for
* a given web request.

View File

@ -17,7 +17,6 @@ package org.springframework.security.authentication.event;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.util.ClassUtils;
@ -30,7 +29,7 @@ import org.springframework.util.ClassUtils;
* @author Ben Alex
* @version $Id$
*/
public class LoggerListener implements ApplicationListener {
public class LoggerListener implements ApplicationListener<AbstractAuthenticationEvent> {
//~ Static fields/initializers =====================================================================================
private static final Log logger = LogFactory.getLog(LoggerListener.class);
@ -40,7 +39,7 @@ public class LoggerListener implements ApplicationListener {
//~ Methods ========================================================================================================
public void onApplicationEvent(ApplicationEvent event) {
public void onApplicationEvent(AbstractAuthenticationEvent event) {
if (event instanceof AbstractAuthenticationEvent) {
AbstractAuthenticationEvent authEvent = (AbstractAuthenticationEvent) event;

View File

@ -32,7 +32,6 @@ import javax.security.auth.login.LoginException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.context.ApplicationListener;
@ -127,7 +126,7 @@ import org.springframework.util.Assert;
* @version $Id$
*/
public class JaasAuthenticationProvider implements AuthenticationProvider, ApplicationEventPublisherAware,
InitializingBean, ApplicationListener {
InitializingBean, ApplicationListener<SessionDestroyedEvent> {
//~ Static fields/initializers =====================================================================================
protected static final Log log = LogFactory.getLog(JaasAuthenticationProvider.class);
@ -339,11 +338,8 @@ public class JaasAuthenticationProvider implements AuthenticationProvider, Appli
}
}
public void onApplicationEvent(ApplicationEvent applicationEvent) {
if (applicationEvent instanceof SessionDestroyedEvent) {
SessionDestroyedEvent event = (SessionDestroyedEvent) applicationEvent;
handleLogout(event);
}
public void onApplicationEvent(SessionDestroyedEvent event) {
handleLogout(event);
}
/**

View File

@ -15,20 +15,17 @@
package org.springframework.security.authentication.jaas;
import org.springframework.context.ApplicationListener;
import org.springframework.security.authentication.jaas.event.JaasAuthenticationEvent;
import org.springframework.security.authentication.jaas.event.JaasAuthenticationFailedEvent;
import org.springframework.security.authentication.jaas.event.JaasAuthenticationSuccessEvent;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
/**
* DOCUMENT ME!
*
* @author Ray Krueger
* @version $Id$
*/
public class JaasEventCheck implements ApplicationListener {
public class JaasEventCheck implements ApplicationListener<JaasAuthenticationEvent> {
//~ Instance fields ================================================================================================
JaasAuthenticationFailedEvent failedEvent;
@ -36,7 +33,7 @@ public class JaasEventCheck implements ApplicationListener {
//~ Methods ========================================================================================================
public void onApplicationEvent(ApplicationEvent event) {
public void onApplicationEvent(JaasAuthenticationEvent event) {
if (event instanceof JaasAuthenticationFailedEvent) {
failedEvent = (JaasAuthenticationFailedEvent) event;
}