Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
import org.eclipse.aether.internal.impl.checksum.Sha256ChecksumAlgorithmFactory;
import org.eclipse.aether.internal.impl.checksum.Sha512ChecksumAlgorithmFactory;
import org.eclipse.aether.internal.impl.checksum.DefaultChecksumAlgorithmFactorySelector;
import org.eclipse.aether.internal.impl.collect.DependencyCollectorDelegate;
import org.eclipse.aether.internal.impl.collect.bf.BfDependencyCollector;
import org.eclipse.aether.internal.impl.collect.df.DfDependencyCollector;
import org.eclipse.aether.internal.impl.synccontext.DefaultSyncContextFactory;
import org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactorySelector;
import org.eclipse.aether.internal.impl.synccontext.named.SimpleNamedLockFactorySelector;
Expand Down Expand Up @@ -132,8 +135,14 @@ protected void configure()
.to( DefaultRepositorySystem.class ).in( Singleton.class );
bind( ArtifactResolver.class ) //
.to( DefaultArtifactResolver.class ).in( Singleton.class );

bind( DependencyCollector.class ) //
.to( DefaultDependencyCollector.class ).in( Singleton.class );
bind( DependencyCollectorDelegate.class ).annotatedWith( Names.named( BfDependencyCollector.NAME ) ) //
.to( BfDependencyCollector.class ).in( Singleton.class );
bind( DependencyCollectorDelegate.class ).annotatedWith( Names.named( DfDependencyCollector.NAME ) ) //
.to( DfDependencyCollector.class ).in( Singleton.class );

bind( Deployer.class ) //
.to( DefaultDeployer.class ).in( Singleton.class );
bind( Installer.class ) //
Expand Down Expand Up @@ -212,6 +221,19 @@ protected void configure()

}

@Provides
@Singleton
Map<String, DependencyCollectorDelegate> provideDependencyCollectorDelegates(
@Named( BfDependencyCollector.NAME ) DependencyCollectorDelegate bf,
@Named( DfDependencyCollector.NAME ) DependencyCollectorDelegate df
)
{
Map<String, DependencyCollectorDelegate> providedDependencyCollectorDelegates = new HashMap<>();
providedDependencyCollectorDelegates.put( BfDependencyCollector.NAME, bf );
providedDependencyCollectorDelegates.put( DfDependencyCollector.NAME, df );
return providedDependencyCollectorDelegates;
}

@Provides
@Singleton
Map<String, ProvidedChecksumsSource> provideChecksumSources(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/**
* A short-lived artifact type registry that caches results from a presumedly slower type registry.
*/
class CachingArtifactTypeRegistry
public class CachingArtifactTypeRegistry
implements ArtifactTypeRegistry
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@
import org.eclipse.aether.version.VersionConstraint;

/**
* DataPool.
*/
final class DataPool
public final class DataPool
{

private static final String ARTIFACT_POOL = DataPool.class.getName() + "$Artifact";
Expand All @@ -58,7 +59,7 @@ final class DataPool

private static final String DESCRIPTORS = DataPool.class.getName() + "$Descriptors";

static final ArtifactDescriptorResult NO_DESCRIPTOR =
public static final ArtifactDescriptorResult NO_DESCRIPTOR =
new ArtifactDescriptorResult( new ArtifactDescriptorRequest() );

private ObjectPool<Artifact> artifacts;
Expand All @@ -72,7 +73,7 @@ final class DataPool
private final Map<Object, List<DependencyNode>> nodes = new HashMap<>( 256 );

@SuppressWarnings( "unchecked" )
DataPool( RepositorySystemSession session )
public DataPool( RepositorySystemSession session )
{
RepositoryCache cache = session.getCache();

Expand Down Expand Up @@ -121,12 +122,12 @@ public Dependency intern( Dependency dependency )
return dependencies.intern( dependency );
}

Object toKey( ArtifactDescriptorRequest request )
public Object toKey( ArtifactDescriptorRequest request )
{
return request.getArtifact();
}

ArtifactDescriptorResult getDescriptor( Object key, ArtifactDescriptorRequest request )
public ArtifactDescriptorResult getDescriptor( Object key, ArtifactDescriptorRequest request )
{
Descriptor descriptor = descriptors.get( key );
if ( descriptor != null )
Expand All @@ -136,22 +137,22 @@ ArtifactDescriptorResult getDescriptor( Object key, ArtifactDescriptorRequest re
return null;
}

void putDescriptor( Object key, ArtifactDescriptorResult result )
public void putDescriptor( Object key, ArtifactDescriptorResult result )
{
descriptors.put( key, new GoodDescriptor( result ) );
}

void putDescriptor( Object key, ArtifactDescriptorException e )
public void putDescriptor( Object key, ArtifactDescriptorException e )
{
descriptors.put( key, BadDescriptor.INSTANCE );
}

Object toKey( VersionRangeRequest request )
public Object toKey( VersionRangeRequest request )
{
return new ConstraintKey( request );
}

VersionRangeResult getConstraint( Object key, VersionRangeRequest request )
public VersionRangeResult getConstraint( Object key, VersionRangeRequest request )
{
Constraint constraint = constraints.get( key );
if ( constraint != null )
Expand All @@ -161,7 +162,7 @@ VersionRangeResult getConstraint( Object key, VersionRangeRequest request )
return null;
}

void putConstraint( Object key, VersionRangeResult result )
public void putConstraint( Object key, VersionRangeResult result )
{
constraints.put( key, new Constraint( result ) );
}
Expand All @@ -182,14 +183,20 @@ public void putChildren( Object key, List<DependencyNode> children )
nodes.put( key, children );
}

abstract static class Descriptor
/**
* Descriptor
*/
public abstract static class Descriptor
{

public abstract ArtifactDescriptorResult toResult( ArtifactDescriptorRequest request );

}

static final class GoodDescriptor
/**
* GoodDescriptor
*/
public static final class GoodDescriptor
extends Descriptor
{

Expand All @@ -205,7 +212,7 @@ static final class GoodDescriptor

final List<Dependency> managedDependencies;

GoodDescriptor( ArtifactDescriptorResult result )
public GoodDescriptor( ArtifactDescriptorResult result )
{
artifact = result.getArtifact();
relocations = result.getRelocations();
Expand All @@ -229,7 +236,10 @@ public ArtifactDescriptorResult toResult( ArtifactDescriptorRequest request )

}

static final class BadDescriptor
/**
* BadDescriptor
*/
public static final class BadDescriptor
extends Descriptor
{

Expand Down Expand Up @@ -285,15 +295,18 @@ static final class VersionRepo
}
}

static final class ConstraintKey
/**
* ConstraintKey
*/
public static final class ConstraintKey
{
private final Artifact artifact;

private final List<RemoteRepository> repositories;

private final int hashCode;

ConstraintKey( VersionRangeRequest request )
public ConstraintKey( VersionRangeRequest request )
{
artifact = request.getArtifact();
repositories = request.getRepositories();
Expand Down Expand Up @@ -360,7 +373,10 @@ public int hashCode()
}
}

static final class GraphKey
/**
* GraphKey
*/
public static final class GraphKey
{
private final Artifact artifact;

Expand All @@ -376,7 +392,7 @@ static final class GraphKey

private final int hashCode;

GraphKey( Artifact artifact, List<RemoteRepository> repositories, DependencySelector selector,
public GraphKey( Artifact artifact, List<RemoteRepository> repositories, DependencySelector selector,
DependencyManager manager, DependencyTraverser traverser, VersionFilter filter )
{
this.artifact = artifact;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/**
* @see DefaultDependencyCollector
*/
final class DefaultDependencyCollectionContext
public final class DefaultDependencyCollectionContext
implements DependencyCollectionContext
{

Expand All @@ -41,7 +41,7 @@ final class DefaultDependencyCollectionContext

private List<Dependency> managedDependencies;

DefaultDependencyCollectionContext( RepositorySystemSession session, Artifact artifact,
public DefaultDependencyCollectionContext( RepositorySystemSession session, Artifact artifact,
Dependency dependency, List<Dependency> managedDependencies )
{
this.session = session;
Expand Down
Loading