Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.eclipse.aether.internal.impl.collect;
import java.lang.ref.WeakReference;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.aether.RepositoryCache;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.collection.DependencyManager;
import org.eclipse.aether.collection.DependencySelector;
import org.eclipse.aether.collection.DependencyTraverser;
import org.eclipse.aether.collection.VersionFilter;
import org.eclipse.aether.graph.Dependency;
import org.eclipse.aether.graph.DependencyNode;
import org.eclipse.aether.repository.ArtifactRepository;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactDescriptorException;
import org.eclipse.aether.resolution.ArtifactDescriptorRequest;
import org.eclipse.aether.resolution.ArtifactDescriptorResult;
import org.eclipse.aether.resolution.VersionRangeRequest;
import org.eclipse.aether.resolution.VersionRangeResult;
import org.eclipse.aether.util.ConfigUtils;
import org.eclipse.aether.version.Version;
import org.eclipse.aether.version.VersionConstraint;
/**
* Internal helper class for collector implementations.
*/
public final class DataPool {
public static final String CONFIG_PROPS_PREFIX = DefaultDependencyCollector.CONFIG_PROPS_PREFIX + "pool.";
/**
* Flag controlling interning data pool type used by dependency collector for Artifact instances, matters for
* heap consumption. By default, uses “weak” references (consume less heap). Using “hard” will make it much
* more memory aggressive and possibly faster (system and Java dependent). Supported values: "hard", "weak".
*
* @since 1.9.5
* @configurationSource {@link RepositorySystemSession#getConfigProperties()}
* @configurationType {@link java.lang.String}
* @configurationDefaultValue {@link #WEAK}
*/
public static final String CONFIG_PROP_COLLECTOR_POOL_ARTIFACT = CONFIG_PROPS_PREFIX + "artifact";
/**
* Flag controlling interning data pool type used by dependency collector for Dependency instances, matters for
* heap consumption. By default, uses “weak” references (consume less heap). Using “hard” will make it much
* more memory aggressive and possibly faster (system and Java dependent). Supported values: "hard", "weak".
*
* @since 1.9.5
* @configurationSource {@link RepositorySystemSession#getConfigProperties()}
* @configurationType {@link java.lang.String}
* @configurationDefaultValue {@link #WEAK}
*/
public static final String CONFIG_PROP_COLLECTOR_POOL_DEPENDENCY = CONFIG_PROPS_PREFIX + "dependency";
/**
* Flag controlling interning data pool type used by dependency collector for ArtifactDescriptor (POM) instances,
* matters for heap consumption. By default, uses “weak” references (consume less heap). Using “hard” will make it
* much more memory aggressive and possibly faster (system and Java dependent). Supported values: "hard", "weak".
*
* @since 1.9.5
* @configurationSource {@link RepositorySystemSession#getConfigProperties()}
* @configurationType {@link java.lang.String}
* @configurationDefaultValue {@link #HARD}
*/
public static final String CONFIG_PROP_COLLECTOR_POOL_DESCRIPTOR = CONFIG_PROPS_PREFIX + "descriptor";
/**
* Flag controlling interning data pool type used by dependency lists collector for ArtifactDescriptor (POM) instances,
* matters for heap consumption. By default, uses “weak” references (consume less heap). Using “hard” will make it
* much more memory aggressive and possibly faster (system and Java dependent). Supported values: "hard", "weak".
*
* @since 1.9.22
* @configurationSource {@link RepositorySystemSession#getConfigProperties()}
* @configurationType {@link java.lang.String}
* @configurationDefaultValue {@link #HARD}
*/
public static final String CONFIG_PROP_COLLECTOR_POOL_DEPENDENCY_LISTS =
"aether.dependencyCollector.pool.dependencyLists";
/**
* Flag controlling interning artifact descriptor dependencies.
*
* @since 1.9.22
* @configurationSource {@link RepositorySystemSession#getConfigProperties()}
* @configurationType {@link java.lang.Boolean}
* @configurationDefaultValue false
*/
public static final String CONFIG_PROP_COLLECTOR_POOL_INTERN_ARTIFACT_DESCRIPTOR_DEPENDENCIES =
"aether.dependencyCollector.pool.internArtifactDescriptorDependencies";
/**
* Flag controlling interning artifact descriptor managed dependencies.
*
* @since 1.9.22
* @configurationSource {@link RepositorySystemSession#getConfigProperties()}
* @configurationType {@link java.lang.Boolean}
* @configurationDefaultValue true
*/
public static final String CONFIG_PROP_COLLECTOR_POOL_INTERN_ARTIFACT_DESCRIPTOR_MANAGED_DEPENDENCIES =
"aether.dependencyCollector.pool.internArtifactDescriptorManagedDependencies";
private static final String ARTIFACT_POOL = DataPool.class.getName() + "$Artifact";
private static final String DEPENDENCY_POOL = DataPool.class.getName() + "$Dependency";
private static final String DESCRIPTORS = DataPool.class.getName() + "$Descriptors";
private static final String DEPENDENCY_LISTS_POOL = DataPool.class.getName() + "$DependencyLists";
public static final ArtifactDescriptorResult NO_DESCRIPTOR =
new ArtifactDescriptorResult(new ArtifactDescriptorRequest());
/**
* Artifact interning pool, lives across session (if session carries non-null {@link RepositoryCache}).
*/
private final InternPool artifacts;
/**
* Dependency interning pool, lives across session (if session carries non-null {@link RepositoryCache}).
*/
private final InternPool dependencies;
/**
* Descriptor interning pool, lives across session (if session carries non-null {@link RepositoryCache}).
*/
private final InternPool descriptors;
/**
* {@link Dependency} list interning pool, lives across session (if session carries non-null {@link RepositoryCache}).
*/
private final InternPool, List> dependencyLists;
/**
* Constraint cache, lives during single collection invocation (same as this DataPool instance).
*/
private final ConcurrentHashMap