Search in sources :

Example 11 with IArtifactRepositoryManager

use of org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager in project tycho by eclipse.

the class RemoteAgent method addMavenAwareRepositoryManagers.

private static void addMavenAwareRepositoryManagers(AgentBuilder agent, MavenRepositorySettings mavenRepositorySettings, MavenLogger logger) {
    // register service which stores mapping between URLs and IDs (used by Maven)
    RemoteRepositoryLoadingHelper loadingHelper = new RemoteRepositoryLoadingHelper(mavenRepositorySettings, logger);
    agent.registerService(IRepositoryIdManager.class, loadingHelper);
    // wrap metadata repository manager
    IMetadataRepositoryManager plainMetadataRepoManager = agent.getService(IMetadataRepositoryManager.class);
    IMetadataRepositoryManager remoteMetadataRepoManager = new RemoteMetadataRepositoryManager(plainMetadataRepoManager, loadingHelper, logger);
    agent.registerService(IMetadataRepositoryManager.class, remoteMetadataRepoManager);
    // wrap artifact repository manager
    IArtifactRepositoryManager plainArtifactRepoManager = agent.getService(IArtifactRepositoryManager.class);
    RemoteArtifactRepositoryManager remoteArtifactRepoManager = new RemoteArtifactRepositoryManager(plainArtifactRepoManager, loadingHelper);
    agent.registerService(IArtifactRepositoryManager.class, remoteArtifactRepoManager);
}
Also used : IMetadataRepositoryManager(org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager) IArtifactRepositoryManager(org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager)

Aggregations

IArtifactRepositoryManager (org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager)10 URI (java.net.URI)5 IProvisioningAgent (org.eclipse.equinox.p2.core.IProvisioningAgent)5 IMetadataRepositoryManager (org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager)4 IArtifactRepository (org.eclipse.equinox.p2.repository.artifact.IArtifactRepository)3 BundleContext (org.osgi.framework.BundleContext)3 File (java.io.File)2 BufferedOutputStream (java.io.BufferedOutputStream)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 IStatus (org.eclipse.core.runtime.IStatus)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 CompositeArtifactRepository (org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository)1 CompositeMetadataRepository (org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository)1