use of org.springframework.security.authentication.event.AbstractAuthenticationEvent in project spring-security by spring-projects.
the class DefaultAuthenticationEventPublisher method publishAuthenticationFailure.
public void publishAuthenticationFailure(AuthenticationException exception, Authentication authentication) {
Constructor<? extends AbstractAuthenticationEvent> constructor = exceptionMappings.get(exception.getClass().getName());
AbstractAuthenticationEvent event = null;
if (constructor != null) {
try {
event = constructor.newInstance(authentication, exception);
} catch (IllegalAccessException ignored) {
} catch (InstantiationException ignored) {
} catch (InvocationTargetException ignored) {
}
}
if (event != null) {
if (applicationEventPublisher != null) {
applicationEventPublisher.publishEvent(event);
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("No event was found for the exception " + exception.getClass().getName());
}
}
}
Aggregations