org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager Java Examples
The following examples show how to use
org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: InstallWizardOpener.java From statecharts with Eclipse Public License 1.0 | 6 votes |
public void open(Map<String, Set<String>> features, IProgressMonitor monitor) { try { IProvisioningAgent agent = agentProvider.get(); IMetadataRepositoryManager manager = (IMetadataRepositoryManager) agent .getService(IMetadataRepositoryManager.SERVICE_NAME); Set<IInstallableUnit> units = collectIUs(features, manager, monitor); if (monitor.isCanceled()) return; List<URI> knownRepos = Arrays.asList(manager.getKnownRepositories(IRepositoryManager.REPOSITORIES_ALL)); InstallOperation op = new OperationFactory().createInstallOperation(units, knownRepos, monitor); agent.stop(); open(units, op); } catch (ProvisionException e) { e.printStackTrace(); } }
Example #2
Source File: UpdateManager.java From developer-studio with Apache License 2.0 | 6 votes |
protected void initProvisioningAgent() throws RuntimeException { try { // Inject references BundleContext bundleContext = FrameworkUtil.getBundle(UpdateManager.class).getBundleContext(); IEclipseContext serviceContext = EclipseContextFactory.getServiceContext(bundleContext); ContextInjectionFactory.inject(this, serviceContext); // get p2 agent for current system(Eclipse instance in this // case) // the location for the currently running system is null (see // docs) p2Agent = agentProvider.createAgent(null); session = new ProvisioningSession(p2Agent); artifactRepoManager = (IArtifactRepositoryManager) p2Agent .getService(IArtifactRepositoryManager.class.getName()); metadataRepoManager = (IMetadataRepositoryManager) p2Agent .getService(IMetadataRepositoryManager.class.getName()); } catch (Exception e) { throw new RuntimeException(Messages.UpdateManager_14, e); } }
Example #3
Source File: P2Util.java From elexis-3-core with Eclipse Public License 1.0 | 6 votes |
/** * Add a repository to declared updates repositories. * * @param repo * @return */ public static boolean addRepository(IProvisioningAgent agent, String repo){ System.out.println(">> adding repository " + repo); IMetadataRepositoryManager metadataManager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME); IArtifactRepositoryManager artifactManager = (IArtifactRepositoryManager) agent.getService(IArtifactRepositoryManager.SERVICE_NAME); if (metadataManager == null) { System.out.println("metadataManager is null!!!"); return false; } if (artifactManager == null) { System.out.println("artifactManager is null!!!"); return false; } try { URI uri = new URI(repo); metadataManager.addRepository(uri); artifactManager.addRepository(uri); return true; } catch (Exception e) { e.printStackTrace(); return false; } }
Example #4
Source File: Processor.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public Processor ( final IProvisioningAgent agent, final File output, final URI repositoryLocation, final Properties properties ) throws Exception { this.mapping = makeMappingInstance ( properties ); this.agent = agent; this.output = output; this.properties = properties; this.repositoryLocation = repositoryLocation; this.metaManager = (IMetadataRepositoryManager)this.agent.getService ( IMetadataRepositoryManager.SERVICE_NAME ); this.artManager = (IArtifactRepositoryManager)this.agent.getService ( IArtifactRepositoryManager.SERVICE_NAME ); this.documentBuilderFactor = DocumentBuilderFactory.newInstance (); this.documentBuilder = this.documentBuilderFactor.newDocumentBuilder (); this.transformerFactory = TransformerFactory.newInstance (); this.organizationName = properties.getProperty ( "pom.organization.name", "Eclipse Foundation" ); this.organizationUrl = properties.getProperty ( "pom.organization.url", "http://www.eclipse.org/" ); this.licenseProvider = new LicenseProvider ( this.properties ); this.scrubJars = Boolean.parseBoolean ( properties.getProperty ( "scrubJars" ) ); this.checkQualifier = Boolean.parseBoolean ( properties.getProperty ( "checkQualifier", "true" ) ); loadDevelopers (); setupBndTools (); }
Example #5
Source File: Processor.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public Processor ( final IProvisioningAgent agent, final File output, final URI repositoryLocation, final Properties properties ) throws Exception { this.mapping = makeMappingInstance ( properties ); this.agent = agent; this.output = output; this.properties = properties; this.repositoryLocation = repositoryLocation; this.metaManager = (IMetadataRepositoryManager)this.agent.getService ( IMetadataRepositoryManager.SERVICE_NAME ); this.artManager = (IArtifactRepositoryManager)this.agent.getService ( IArtifactRepositoryManager.SERVICE_NAME ); this.documentBuilderFactor = DocumentBuilderFactory.newInstance (); this.documentBuilder = this.documentBuilderFactor.newDocumentBuilder (); this.transformerFactory = TransformerFactory.newInstance (); this.organizationName = properties.getProperty ( "pom.origanization.name", "Eclipse Foundation" ); this.organizationUrl = properties.getProperty ( "pom.origanization.url", "http://www.eclipse.org/" ); this.licenseProvider = new LicenseProvider ( this.properties ); this.scrubJars = Boolean.parseBoolean ( properties.getProperty ( "scrubJars" ) ); this.checkQualifier = Boolean.parseBoolean ( properties.getProperty ( "checkQualifier", "true" ) ); loadDevelopers (); setupBndTools (); }