From 907ffd42d81bb8db21c36666f02efac20a3e945c Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 18 Feb 2013 20:30:51 +0000 Subject: [PATCH] this optimisation was very crappy in fact so remove it: too much synchronization were needed git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1447476 13f79535-47bb-0310-9956-ffa450edef68 --- .../beans/RedbackRuntimeConfiguration.java | 4 ---- ...faultRedbackRuntimeConfigurationAdmin.java | 22 ++++--------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RedbackRuntimeConfiguration.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RedbackRuntimeConfiguration.java index cf9224697..99c8b893b 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RedbackRuntimeConfiguration.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RedbackRuntimeConfiguration.java @@ -118,10 +118,6 @@ public class RedbackRuntimeConfiguration public List getConfigurationPropertiesEntries() { - if ( configurationPropertiesEntries != null ) - { - return configurationPropertiesEntries; - } configurationPropertiesEntries = new ArrayList( getConfigurationProperties().size() ); for ( Map.Entry entry : getConfigurationProperties().entrySet() ) { diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java index c96b46276..35dbf6d21 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java @@ -55,7 +55,7 @@ import java.util.Set; */ @Service( "userConfiguration#archiva" ) public class DefaultRedbackRuntimeConfigurationAdmin - implements RedbackRuntimeConfigurationAdmin, UserConfiguration, ConfigurationListener + implements RedbackRuntimeConfigurationAdmin, UserConfiguration { protected Logger log = LoggerFactory.getLogger( getClass() ); @@ -71,8 +71,6 @@ public class DefaultRedbackRuntimeConfigurationAdmin @Named( value = "cache#users" ) private Cache usersCache; - private volatile RedbackRuntimeConfiguration currentRedbackRuntimeConfiguration; - @PostConstruct public void initialize() throws UserConfigurationException @@ -221,8 +219,6 @@ public class DefaultRedbackRuntimeConfigurationAdmin updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration ); } - this.currentRedbackRuntimeConfiguration = redbackRuntimeConfiguration; - } catch ( RepositoryAdminException e ) { @@ -232,7 +228,7 @@ public class DefaultRedbackRuntimeConfigurationAdmin public RedbackRuntimeConfiguration getRedbackRuntimeConfiguration() { - return build( archivaConfiguration.getConfiguration().getRedbackRuntimeConfiguration(), false ); + return build( archivaConfiguration.getConfiguration().getRedbackRuntimeConfiguration() ); } public void updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration ) @@ -245,7 +241,6 @@ public class DefaultRedbackRuntimeConfigurationAdmin try { archivaConfiguration.save( configuration ); - this.currentRedbackRuntimeConfiguration = redbackRuntimeConfiguration; } catch ( RegistryException e ) { @@ -258,12 +253,8 @@ public class DefaultRedbackRuntimeConfigurationAdmin } private RedbackRuntimeConfiguration build( - org.apache.archiva.configuration.RedbackRuntimeConfiguration runtimeConfiguration, boolean force ) + org.apache.archiva.configuration.RedbackRuntimeConfiguration runtimeConfiguration ) { - if ( this.currentRedbackRuntimeConfiguration != null && !force ) - { - return this.currentRedbackRuntimeConfiguration; - } RedbackRuntimeConfiguration redbackRuntimeConfiguration = new BeanReplicator().replicateBean( runtimeConfiguration, RedbackRuntimeConfiguration.class ); @@ -294,8 +285,6 @@ public class DefaultRedbackRuntimeConfigurationAdmin cleanupProperties( redbackRuntimeConfiguration ); - this.currentRedbackRuntimeConfiguration = redbackRuntimeConfiguration; - return redbackRuntimeConfiguration; } @@ -629,8 +618,5 @@ public class DefaultRedbackRuntimeConfigurationAdmin return keysSet; } - public void configurationEvent( ConfigurationEvent event ) - { - build( archivaConfiguration.getConfiguration().getRedbackRuntimeConfiguration(), true ); - } + } -- 2.39.5