From da4adf3f65b69e56bd2be5bb3fc54ad1c260066a Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 21 Jan 2013 16:36:55 +0000 Subject: [PATCH] no need to read the configuration every time git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1436467 13f79535-47bb-0310-9956-ffa450edef68 --- .../ArchivaConfigurableUsersManager.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java index 853b14d15..bead5a99b 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java @@ -42,7 +42,7 @@ import java.util.Map; * @author Olivier Lamy * @since 1.4-M4 */ -@Service("userManager#archiva") +@Service( "userManager#archiva" ) public class ArchivaConfigurableUsersManager extends ConfigurableUserManager { @@ -58,8 +58,10 @@ public class ArchivaConfigurableUsersManager private List listeners = new ArrayList(); @Inject - @Named(value = "cache#users") - private Cache usersCache; + @Named( value = "cache#users" ) + private Cache usersCache; + + private boolean useUsersCache; @Override public void initialize() @@ -77,6 +79,8 @@ public class ArchivaConfigurableUsersManager setUserManagerImpl( userManagerImpl ); userManagerPerId.put( id, userManagerImpl ); } + + this.useUsersCache = redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().isUseUsersCache(); } catch ( RepositoryAdminException e ) { @@ -88,15 +92,7 @@ public class ArchivaConfigurableUsersManager protected boolean useUsersCache() { - try - { - return redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().isUseUsersCache(); - } - catch ( RepositoryAdminException e ) - { - log.warn( "skip fail to get RedbackRuntimeConfiguration: {}, use false", e.getMessage(), e ); - return false; - } + return this.useUsersCache; } @Override -- 2.39.5