mirror of https://github.com/apache/archiva.git
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
This commit is contained in:
parent
95f86b2fe2
commit
907ffd42d8
|
@ -118,10 +118,6 @@ public class RedbackRuntimeConfiguration
|
||||||
|
|
||||||
public List<PropertyEntry> getConfigurationPropertiesEntries()
|
public List<PropertyEntry> getConfigurationPropertiesEntries()
|
||||||
{
|
{
|
||||||
if ( configurationPropertiesEntries != null )
|
|
||||||
{
|
|
||||||
return configurationPropertiesEntries;
|
|
||||||
}
|
|
||||||
configurationPropertiesEntries = new ArrayList<PropertyEntry>( getConfigurationProperties().size() );
|
configurationPropertiesEntries = new ArrayList<PropertyEntry>( getConfigurationProperties().size() );
|
||||||
for ( Map.Entry<String, String> entry : getConfigurationProperties().entrySet() )
|
for ( Map.Entry<String, String> entry : getConfigurationProperties().entrySet() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,7 +55,7 @@ import java.util.Set;
|
||||||
*/
|
*/
|
||||||
@Service( "userConfiguration#archiva" )
|
@Service( "userConfiguration#archiva" )
|
||||||
public class DefaultRedbackRuntimeConfigurationAdmin
|
public class DefaultRedbackRuntimeConfigurationAdmin
|
||||||
implements RedbackRuntimeConfigurationAdmin, UserConfiguration, ConfigurationListener
|
implements RedbackRuntimeConfigurationAdmin, UserConfiguration
|
||||||
{
|
{
|
||||||
|
|
||||||
protected Logger log = LoggerFactory.getLogger( getClass() );
|
protected Logger log = LoggerFactory.getLogger( getClass() );
|
||||||
|
@ -71,8 +71,6 @@ public class DefaultRedbackRuntimeConfigurationAdmin
|
||||||
@Named( value = "cache#users" )
|
@Named( value = "cache#users" )
|
||||||
private Cache usersCache;
|
private Cache usersCache;
|
||||||
|
|
||||||
private volatile RedbackRuntimeConfiguration currentRedbackRuntimeConfiguration;
|
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void initialize()
|
public void initialize()
|
||||||
throws UserConfigurationException
|
throws UserConfigurationException
|
||||||
|
@ -221,8 +219,6 @@ public class DefaultRedbackRuntimeConfigurationAdmin
|
||||||
updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
|
updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
|
||||||
}
|
}
|
||||||
|
|
||||||
this.currentRedbackRuntimeConfiguration = redbackRuntimeConfiguration;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch ( RepositoryAdminException e )
|
catch ( RepositoryAdminException e )
|
||||||
{
|
{
|
||||||
|
@ -232,7 +228,7 @@ public class DefaultRedbackRuntimeConfigurationAdmin
|
||||||
|
|
||||||
public RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
|
public RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
|
||||||
{
|
{
|
||||||
return build( archivaConfiguration.getConfiguration().getRedbackRuntimeConfiguration(), false );
|
return build( archivaConfiguration.getConfiguration().getRedbackRuntimeConfiguration() );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
|
public void updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
|
||||||
|
@ -245,7 +241,6 @@ public class DefaultRedbackRuntimeConfigurationAdmin
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
archivaConfiguration.save( configuration );
|
archivaConfiguration.save( configuration );
|
||||||
this.currentRedbackRuntimeConfiguration = redbackRuntimeConfiguration;
|
|
||||||
}
|
}
|
||||||
catch ( RegistryException e )
|
catch ( RegistryException e )
|
||||||
{
|
{
|
||||||
|
@ -258,12 +253,8 @@ public class DefaultRedbackRuntimeConfigurationAdmin
|
||||||
}
|
}
|
||||||
|
|
||||||
private RedbackRuntimeConfiguration build(
|
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 =
|
RedbackRuntimeConfiguration redbackRuntimeConfiguration =
|
||||||
new BeanReplicator().replicateBean( runtimeConfiguration, RedbackRuntimeConfiguration.class );
|
new BeanReplicator().replicateBean( runtimeConfiguration, RedbackRuntimeConfiguration.class );
|
||||||
|
|
||||||
|
@ -294,8 +285,6 @@ public class DefaultRedbackRuntimeConfigurationAdmin
|
||||||
|
|
||||||
cleanupProperties( redbackRuntimeConfiguration );
|
cleanupProperties( redbackRuntimeConfiguration );
|
||||||
|
|
||||||
this.currentRedbackRuntimeConfiguration = redbackRuntimeConfiguration;
|
|
||||||
|
|
||||||
return redbackRuntimeConfiguration;
|
return redbackRuntimeConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -629,8 +618,5 @@ public class DefaultRedbackRuntimeConfigurationAdmin
|
||||||
return keysSet;
|
return keysSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void configurationEvent( ConfigurationEvent event )
|
|
||||||
{
|
|
||||||
build( archivaConfiguration.getConfiguration().getRedbackRuntimeConfiguration(), true );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue