diff options
Diffstat (limited to 'archiva-modules/archiva-web/archiva-rest')
-rw-r--r-- | archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaRuntimeConfigurationService.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaRuntimeConfigurationService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaRuntimeConfigurationService.java index e39af9ba7..c83feb2b3 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaRuntimeConfigurationService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaRuntimeConfigurationService.java @@ -21,7 +21,9 @@ package org.apache.archiva.rest.services; import org.apache.archiva.admin.model.RepositoryAdminException; import org.apache.archiva.admin.model.beans.ArchivaRuntimeConfiguration; import org.apache.archiva.admin.model.beans.CacheConfiguration; +import org.apache.archiva.admin.model.beans.FileLockConfiguration; import org.apache.archiva.admin.model.runtime.ArchivaRuntimeConfigurationAdmin; +import org.apache.archiva.common.filelock.FileLockManager; import org.apache.archiva.redback.components.cache.Cache; import org.apache.archiva.rest.api.services.ArchivaRestServiceException; import org.apache.archiva.rest.api.services.ArchivaRuntimeConfigurationService; @@ -46,6 +48,10 @@ public class DefaultArchivaRuntimeConfigurationService @Named( value = "cache#url-failures-cache" ) private Cache usersCache; + @Inject + @Named( value = "fileLockManager#default" ) + private FileLockManager fileLockManager; + public ArchivaRuntimeConfiguration getArchivaRuntimeConfiguration() throws ArchivaRestServiceException { @@ -73,6 +79,15 @@ public class DefaultArchivaRuntimeConfigurationService usersCache.setMaxElementsOnDisk( cacheConfiguration.getMaxElementsOnDisk() ); usersCache.setMaxElementsInMemory( cacheConfiguration.getMaxElementsInMemory() ); } + + FileLockConfiguration fileLockConfiguration = archivaRuntimeConfiguration.getFileLockConfiguration(); + if ( fileLockConfiguration != null ) + { + fileLockManager.setTimeout( fileLockConfiguration.getLockingTimeout() ); + fileLockConfiguration.setSkipLocking( fileLockConfiguration.isSkipLocking() ); + } + + } catch ( RepositoryAdminException e ) { |