diff options
author | Olivier Lamy <olamy@apache.org> | 2013-12-13 04:47:10 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2013-12-13 04:47:10 +0000 |
commit | 679725dd5dad5315384fde790cee38676f5a17e5 (patch) | |
tree | 59d57ed498ab2d1e811281183edb8aabd59282e6 /archiva-modules/archiva-web/archiva-rest | |
parent | 49c91d619df1e9f06d4b33f7b3e7b2e6c1135299 (diff) | |
download | archiva-679725dd5dad5315384fde790cee38676f5a17e5.tar.gz archiva-679725dd5dad5315384fde790cee38676f5a17e5.zip |
file lock manager must be configurable
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1550639 13f79535-47bb-0310-9956-ffa450edef68
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 ) { |