mirror of https://github.com/apache/archiva.git
[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:
parent
02377d34c1
commit
0ad4610548
|
@ -36,11 +36,12 @@ import java.util.List;
|
||||||
import java.util.Map;
|
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>
|
* @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)
|
* @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
|
public class DefaultProxyManager
|
||||||
implements ProxyManager
|
implements ProxyManager
|
||||||
|
@ -64,12 +65,12 @@ public class DefaultProxyManager
|
||||||
/**
|
/**
|
||||||
* The proxy groups for each managed repository.
|
* The proxy groups for each managed repository.
|
||||||
*/
|
*/
|
||||||
private Map/*<String,ProxiedRepositoryGroup>*/ proxyGroups;
|
private static Map/*<String,ProxiedRepositoryGroup>*/ proxyGroups;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default proxy group/managed repository.
|
* The default proxy group/managed repository.
|
||||||
*/
|
*/
|
||||||
private ProxiedRepositoryGroup defaultProxyGroup;
|
private static ProxiedRepositoryGroup defaultProxyGroup;
|
||||||
|
|
||||||
public File get( String path )
|
public File get( String path )
|
||||||
throws ProxyException, ResourceDoesNotExistException
|
throws ProxyException, ResourceDoesNotExistException
|
||||||
|
|
|
@ -52,10 +52,11 @@ import java.util.List;
|
||||||
import java.util.Map;
|
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>
|
* @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 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.
|
* @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.
|
* The checksum handling is inconsistent with that of the wagon manager.
|
||||||
|
@ -82,11 +83,6 @@ public class DefaultProxyRequestHandler
|
||||||
*/
|
*/
|
||||||
private Map/*<String,Wagon>*/ wagons;
|
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 )
|
public File get( String path, List proxiedRepositories, ArtifactRepository managedRepository )
|
||||||
throws ProxyException, ResourceDoesNotExistException
|
throws ProxyException, ResourceDoesNotExistException
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,16 +30,12 @@
|
||||||
<appenders>
|
<appenders>
|
||||||
<appender>
|
<appender>
|
||||||
<id>console</id>
|
<id>console</id>
|
||||||
<threshold>DEBUG</threshold>
|
<threshold>WARN</threshold>
|
||||||
<type>org.apache.log4j.ConsoleAppender</type>
|
<type>org.apache.log4j.ConsoleAppender</type>
|
||||||
<conversion-pattern>%d [%t] %-5p %-30c{1} - %m%n</conversion-pattern>
|
<conversion-pattern>%d [%t] %-5p %-30c{1} - %m%n</conversion-pattern>
|
||||||
</appender>
|
</appender>
|
||||||
</appenders>
|
</appenders>
|
||||||
<levels>
|
<levels>
|
||||||
<level>
|
|
||||||
<hierarchy>org.codehaus.plexus.velocity</hierarchy>
|
|
||||||
<level>WARN</level>
|
|
||||||
</level>
|
|
||||||
<level>
|
<level>
|
||||||
<hierarchy>org.codehaus.plexus.mailsender.MailSender</hierarchy>
|
<hierarchy>org.codehaus.plexus.mailsender.MailSender</hierarchy>
|
||||||
<level>INFO</level>
|
<level>INFO</level>
|
||||||
|
@ -56,6 +52,10 @@
|
||||||
<hierarchy>com.opensymphony.webwork</hierarchy>
|
<hierarchy>com.opensymphony.webwork</hierarchy>
|
||||||
<level>INFO</level>
|
<level>INFO</level>
|
||||||
</level>
|
</level>
|
||||||
|
<level>
|
||||||
|
<hierarchy>org.apache.maven.repository</hierarchy>
|
||||||
|
<level>DEBUG</level>
|
||||||
|
</level>
|
||||||
</levels>
|
</levels>
|
||||||
</configuration>
|
</configuration>
|
||||||
</component>
|
</component>
|
||||||
|
|
Loading…
Reference in New Issue