/** * Helper method which generates an exception containing the passed reason, and * publishes an event to the application context. * <p> * 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; }
/** * Helper method which generates an exception containing the passed reason, and * publishes an event to the application context. * <p> * 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; }
publishEvent(new PublicInvocationEvent(object)); publishEvent(new AuthorizationFailureEvent(object, attributes, authenticated, accessDeniedException)); publishEvent(new AuthorizedEvent(object, attributes, authenticated));
publishEvent(new PublicInvocationEvent(object)); publishEvent(new AuthorizationFailureEvent(object, attributes, authenticated, accessDeniedException)); publishEvent(new AuthorizedEvent(object, attributes, authenticated));
.getSecurityContext().getAuthentication(), accessDeniedException); publishEvent(event);
.getSecurityContext().getAuthentication(), accessDeniedException); publishEvent(event);
/** * Helper method which generates an exception containing the passed reason, * and publishes an event to the application context. * <p> * 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; }
/** * Helper method which generates an exception containing the passed reason, and * publishes an event to the application context. * <p> * 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; }
publishEvent(new PublicInvocationEvent(object)); publishEvent(new AuthorizationFailureEvent(object, attributes, authenticated, accessDeniedException)); publishEvent(new AuthorizedEvent(object, attributes, authenticated));
publishEvent(new PublicInvocationEvent(object)); publishEvent(new AuthorizationFailureEvent(object, attributes, authenticated, accessDeniedException)); publishEvent(new AuthorizedEvent(object, attributes, authenticated));
/** * Completes the work of the <tt>AbstractSecurityInterceptor</tt> after the secure object invocation has been * completed. * * @param token as returned by the {@link #beforeInvocation(Object)}} method * @param returnedObject any object returned from the secure object invocation (may be <tt>null</tt>) * @return the object the secure object invocation should ultimately return to its caller (may be <tt>null</tt>) */ protected Object afterInvocation(InterceptorStatusToken token, Object returnedObject) { if (token == null) { // public object return returnedObject; } finallyInvocation(token); // continue to clean in this method for passivity if (afterInvocationManager != null) { // Attempt after invocation handling try { returnedObject = afterInvocationManager.decide(token.getSecurityContext().getAuthentication(), token.getSecureObject(), token.getAttributes(), returnedObject); } catch (AccessDeniedException accessDeniedException) { AuthorizationFailureEvent event = new AuthorizationFailureEvent(token.getSecureObject(), token .getAttributes(), token.getSecurityContext().getAuthentication(), accessDeniedException); publishEvent(event); throw accessDeniedException; } } return returnedObject; }
.getSecurityContext().getAuthentication(), accessDeniedException); publishEvent(event);