diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java index bb7b09d53..6f56f37fd 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java @@ -36,6 +36,7 @@ import org.apache.archiva.metadata.repository.MetadataRepositoryException; import org.apache.archiva.metadata.repository.RepositorySession; import org.apache.archiva.metadata.repository.RepositorySessionFactory; import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager; +import org.apache.archiva.redback.components.cache.Cache; import org.apache.archiva.redback.components.taskqueue.TaskQueueException; import org.apache.archiva.redback.role.RoleManager; import org.apache.archiva.redback.role.RoleManagerException; @@ -60,6 +61,7 @@ import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -102,6 +104,10 @@ public class DefaultManagedRepositoryAdmin @Inject protected RoleManager roleManager; + @Inject + @Named( value = "cache#namespaces" ) + private Cache> namespacesCache; + // fields List indexCreators; @@ -382,6 +388,8 @@ public class DefaultManagedRepositoryAdmin { MetadataRepository metadataRepository = repositorySession.getRepository(); metadataRepository.removeRepository( repository.getId() ); + //invalidate cache + namespacesCache.remove( repository.getId() ); log.debug( "call repositoryStatisticsManager.deleteStatistics" ); getRepositoryStatisticsManager().deleteStatistics( metadataRepository, repository.getId() ); repositorySession.save();