use of org.sonatype.aether.SyncContext in project sonatype-aether by sonatype.
the class DefaultArtifactResolver method resolveArtifacts.
public List<ArtifactResult> resolveArtifacts(RepositorySystemSession session, Collection<? extends ArtifactRequest> requests) throws ArtifactResolutionException {
SyncContext syncContext = syncContextFactory.newInstance(session, false);
try {
Collection<Artifact> artifacts = new ArrayList<Artifact>(requests.size());
for (ArtifactRequest request : requests) {
if (request.getArtifact().getProperty(ArtifactProperties.LOCAL_PATH, null) != null) {
continue;
}
artifacts.add(request.getArtifact());
}
syncContext.acquire(artifacts, null);
return resolve(session, requests);
} finally {
syncContext.release();
}
}
use of org.sonatype.aether.SyncContext in project sonatype-aether by sonatype.
the class DefaultMetadataResolver method resolveMetadata.
public List<MetadataResult> resolveMetadata(RepositorySystemSession session, Collection<? extends MetadataRequest> requests) {
SyncContext syncContext = syncContextFactory.newInstance(session, false);
try {
Collection<Metadata> metadata = new ArrayList<Metadata>(requests.size());
for (MetadataRequest request : requests) {
metadata.add(request.getMetadata());
}
syncContext.acquire(null, metadata);
return resolve(session, requests);
} finally {
syncContext.release();
}
}
Aggregations