Example usage for org.springframework.security.access.event AuthenticationCredentialsNotFoundEvent AuthenticationCredentialsNotFoundEvent

List of usage examples for org.springframework.security.access.event AuthenticationCredentialsNotFoundEvent AuthenticationCredentialsNotFoundEvent

Introduction

In this page you can find the example usage for org.springframework.security.access.event AuthenticationCredentialsNotFoundEvent AuthenticationCredentialsNotFoundEvent.

Prototype

public AuthenticationCredentialsNotFoundEvent(Object secureObject, Collection<ConfigAttribute> attributes,
        AuthenticationCredentialsNotFoundException credentialsNotFoundException) 

Source Link

Document

Construct the event.

Usage

From source file:springacltutorial.infrastructure.MyMethodSecurityInterceptor.java

/**
 * Helper method which generates an exception containing the passed reason,
 * and publishes an event to the application context.
 * <p>/*w ww  .  j  a va 2  s  .c  om*/
 * Always throws an exception.
 * 
 * @param reason
 *            to be provided in the exception detail
 * @param secureObject
 *            that was being called
 * @param configAttribs
 *            that were defined for the secureObject
 */
private void credentialsNotFound(String reason, Object secureObject,
        Collection<ConfigAttribute> configAttribs) {
    AuthenticationCredentialsNotFoundException exception = new AuthenticationCredentialsNotFoundException(
            reason);

    AuthenticationCredentialsNotFoundEvent event = new AuthenticationCredentialsNotFoundEvent(secureObject,
            configAttribs, exception);
    publishEvent(event);

    throw exception;
}