From 064cd3c7bf3f1e257cbd1bede47538d2b561dd50 Mon Sep 17 00:00:00 2001 From: Ben Alex Date: Tue, 13 Jul 2004 22:10:52 +0000 Subject: [PATCH] Add a getter for the context. --- .../dao/DaoAuthenticationProvider.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/org/acegisecurity/providers/dao/DaoAuthenticationProvider.java b/core/src/main/java/org/acegisecurity/providers/dao/DaoAuthenticationProvider.java index abedcdc695..2d174fa62e 100644 --- a/core/src/main/java/org/acegisecurity/providers/dao/DaoAuthenticationProvider.java +++ b/core/src/main/java/org/acegisecurity/providers/dao/DaoAuthenticationProvider.java @@ -89,7 +89,7 @@ public class DaoAuthenticationProvider implements AuthenticationProvider, InitializingBean, ApplicationContextAware { //~ Instance fields ======================================================== - private ApplicationContext ctx; + private ApplicationContext context; private AuthenticationDao authenticationDao; private PasswordEncoder passwordEncoder = new PlaintextPasswordEncoder(); private SaltSource saltSource; @@ -100,7 +100,7 @@ public class DaoAuthenticationProvider implements AuthenticationProvider, public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - this.ctx = applicationContext; + this.context = applicationContext; } public void setAuthenticationDao(AuthenticationDao authenticationDao) { @@ -111,6 +111,10 @@ public class DaoAuthenticationProvider implements AuthenticationProvider, return authenticationDao; } + public ApplicationContext getContext() { + return context; + } + public void setForcePrincipalAsString(boolean forcePrincipalAsString) { this.forcePrincipalAsString = forcePrincipalAsString; } @@ -189,8 +193,8 @@ public class DaoAuthenticationProvider implements AuthenticationProvider, } if (!user.isEnabled()) { - if (this.ctx != null) { - ctx.publishEvent(new AuthenticationFailureDisabledEvent( + if (this.context != null) { + context.publishEvent(new AuthenticationFailureDisabledEvent( authentication, user)); } @@ -205,8 +209,8 @@ public class DaoAuthenticationProvider implements AuthenticationProvider, } if (!isPasswordCorrect(authentication, user)) { - if (this.ctx != null) { - ctx.publishEvent(new AuthenticationFailurePasswordEvent( + if (this.context != null) { + context.publishEvent(new AuthenticationFailurePasswordEvent( authentication, user)); } @@ -219,8 +223,8 @@ public class DaoAuthenticationProvider implements AuthenticationProvider, this.userCache.putUserInCache(user); // As this appears to be an initial login, publish the event - if (this.ctx != null) { - ctx.publishEvent(new AuthenticationSuccessEvent( + if (this.context != null) { + context.publishEvent(new AuthenticationSuccessEvent( authentication, user)); } }