[MRM-138] make the proxy downloader thread-safe

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@437071 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2006-08-26 03:59:13 +00:00
parent 02377d34c1
commit 0ad4610548
3 changed files with 13 additions and 16 deletions

View File

@ -36,11 +36,12 @@ import java.util.List;
import java.util.Map;
/**
* Default implementation of the proxy manager that bridges the repository configuration classes to the proxy API.
* Default implementation of the proxy manager that bridges the repository configuration classes to the proxy API. This
* class is not thread safe (due to the request handler being a non-thread safe requirement).
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
* @todo we should be able to configure "views" that sit in front of this (ie, prefix = /legacy, appears as layout maven-1.x, path gets translated before being passed on)
* @plexus.component
* @plexus.component instantiation-strategy="per-lookup"
*/
public class DefaultProxyManager
implements ProxyManager
@ -64,12 +65,12 @@ public class DefaultProxyManager
/**
* The proxy groups for each managed repository.
*/
private Map/*<String,ProxiedRepositoryGroup>*/ proxyGroups;
private static Map/*<String,ProxiedRepositoryGroup>*/ proxyGroups;
/**
* The default proxy group/managed repository.
*/
private ProxiedRepositoryGroup defaultProxyGroup;
private static ProxiedRepositoryGroup defaultProxyGroup;
public File get( String path )
throws ProxyException, ResourceDoesNotExistException

View File

@ -52,10 +52,11 @@ import java.util.List;
import java.util.Map;
/**
* An implementation of the proxy handler.
* An implementation of the proxy handler. This class is not thread safe (the class itself is, but the wagons it uses
* are not) - it is declared <code>per-lookup</code> for that reason.
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
* @plexus.component
* @plexus.component instantiation-strategy="per-lookup"
* @todo use wagonManager for cache use file:// as URL
* @todo this currently duplicates a lot of the wagon manager, and doesn't do things like snapshot resolution, etc.
* The checksum handling is inconsistent with that of the wagon manager.
@ -82,11 +83,6 @@ public class DefaultProxyRequestHandler
*/
private Map/*<String,Wagon>*/ wagons;
/**
* @plexus.requirement role="org.apache.maven.repository.digest.Digester"
*/
private Map/*<String,Digester>*/ digesters;
public File get( String path, List proxiedRepositories, ArtifactRepository managedRepository )
throws ProxyException, ResourceDoesNotExistException
{

View File

@ -30,16 +30,12 @@
<appenders>
<appender>
<id>console</id>
<threshold>DEBUG</threshold>
<threshold>WARN</threshold>
<type>org.apache.log4j.ConsoleAppender</type>
<conversion-pattern>%d [%t] %-5p %-30c{1} - %m%n</conversion-pattern>
</appender>
</appenders>
<levels>
<level>
<hierarchy>org.codehaus.plexus.velocity</hierarchy>
<level>WARN</level>
</level>
<level>
<hierarchy>org.codehaus.plexus.mailsender.MailSender</hierarchy>
<level>INFO</level>
@ -56,6 +52,10 @@
<hierarchy>com.opensymphony.webwork</hierarchy>
<level>INFO</level>
</level>
<level>
<hierarchy>org.apache.maven.repository</hierarchy>
<level>DEBUG</level>
</level>
</levels>
</configuration>
</component>