Submit Search
Upload
Discovering the p2 API
•
Download as PPTX, PDF
•
9 likes
•
2,981 views
Pascal Rapicault
Follow
This presentation goes over the main concepts of the p2 API and provide some
Read less
Read more
Technology
Report
Share
Report
Share
1 of 25
Download now
Recommended
Understanding and extending p2 for fun and profit
Understanding and extending p2 for fun and profit
Pascal Rapicault
Do's and Do not's about p2
Do's and Do not's about p2
Pascal Rapicault
Managing Your Runtime With P2
Managing Your Runtime With P2
Pascal Rapicault
p2, modular provisioning for OSGi
p2, modular provisioning for OSGi
Pascal Rapicault
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Ralf Sternberg
P2 Introduction
P2 Introduction
irbull
L0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-in
Tonny Madsen
Building Eclipse Plugins
Building Eclipse Plugins
Liran Zelkha
Recommended
Understanding and extending p2 for fun and profit
Understanding and extending p2 for fun and profit
Pascal Rapicault
Do's and Do not's about p2
Do's and Do not's about p2
Pascal Rapicault
Managing Your Runtime With P2
Managing Your Runtime With P2
Pascal Rapicault
p2, modular provisioning for OSGi
p2, modular provisioning for OSGi
Pascal Rapicault
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Ralf Sternberg
P2 Introduction
P2 Introduction
irbull
L0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-in
Tonny Madsen
Building Eclipse Plugins
Building Eclipse Plugins
Liran Zelkha
Tycho - Building plug-ins with Maven
Tycho - Building plug-ins with Maven
Pascal Rapicault
Eclipse plug in development
Eclipse plug in development
Martin Toshev
Tycho Tutorial EclipseCon 2013
Tycho Tutorial EclipseCon 2013
jsievers
Sleep Peacefully as Maven Tycho Builds your Product
Sleep Peacefully as Maven Tycho Builds your Product
Subramanyam C
PDE Good Practices
PDE Good Practices
Ankur Sharma
PDE builds or Maven
PDE builds or Maven
Eclipse Day India
Concierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded Devices
Jan S. Rellermeyer
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
Ralf Sternberg
Maven 3 / Tycho
Maven 3 / Tycho
Karsten Thoms
Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)
jsievers
Single Sourcing RCP and RAP
Single Sourcing RCP and RAP
Chris Aniszczyk
OSGi, Eclipse and API Tooling
OSGi, Eclipse and API Tooling
Chris Aniszczyk
Lua on Steroids - EclipseCon NA 2012
Lua on Steroids - EclipseCon NA 2012
Benjamin Cabé
Mobile Development integration tests
Mobile Development integration tests
Kenneth Poon
Managing Change
Managing Change
Mirko Jahn
Migrating from PDE to Tycho builds
Migrating from PDE to Tycho builds
Teodor Madan
Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2
Sergii Shymko
Building framework with shared code on Android and iOS using React Native. UA...
Building framework with shared code on Android and iOS using React Native. UA...
UA Mobile
Os Grossupdated
Os Grossupdated
oscon2007
Java Programming (M&M)
Java Programming (M&M)
mafffffe19
Discovery the p2 API (updated to Indigo)
Discovery the p2 API (updated to Indigo)
Pascal Rapicault
Open stack nova reverse engineer
Open stack nova reverse engineer
Vietnam Open Infrastructure User Group
More Related Content
What's hot
Tycho - Building plug-ins with Maven
Tycho - Building plug-ins with Maven
Pascal Rapicault
Eclipse plug in development
Eclipse plug in development
Martin Toshev
Tycho Tutorial EclipseCon 2013
Tycho Tutorial EclipseCon 2013
jsievers
Sleep Peacefully as Maven Tycho Builds your Product
Sleep Peacefully as Maven Tycho Builds your Product
Subramanyam C
PDE Good Practices
PDE Good Practices
Ankur Sharma
PDE builds or Maven
PDE builds or Maven
Eclipse Day India
Concierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded Devices
Jan S. Rellermeyer
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
Ralf Sternberg
Maven 3 / Tycho
Maven 3 / Tycho
Karsten Thoms
Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)
jsievers
Single Sourcing RCP and RAP
Single Sourcing RCP and RAP
Chris Aniszczyk
OSGi, Eclipse and API Tooling
OSGi, Eclipse and API Tooling
Chris Aniszczyk
Lua on Steroids - EclipseCon NA 2012
Lua on Steroids - EclipseCon NA 2012
Benjamin Cabé
Mobile Development integration tests
Mobile Development integration tests
Kenneth Poon
Managing Change
Managing Change
Mirko Jahn
Migrating from PDE to Tycho builds
Migrating from PDE to Tycho builds
Teodor Madan
Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2
Sergii Shymko
Building framework with shared code on Android and iOS using React Native. UA...
Building framework with shared code on Android and iOS using React Native. UA...
UA Mobile
Os Grossupdated
Os Grossupdated
oscon2007
Java Programming (M&M)
Java Programming (M&M)
mafffffe19
What's hot
(20)
Tycho - Building plug-ins with Maven
Tycho - Building plug-ins with Maven
Eclipse plug in development
Eclipse plug in development
Tycho Tutorial EclipseCon 2013
Tycho Tutorial EclipseCon 2013
Sleep Peacefully as Maven Tycho Builds your Product
Sleep Peacefully as Maven Tycho Builds your Product
PDE Good Practices
PDE Good Practices
PDE builds or Maven
PDE builds or Maven
Concierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded Devices
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
Maven 3 / Tycho
Maven 3 / Tycho
Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)
Single Sourcing RCP and RAP
Single Sourcing RCP and RAP
OSGi, Eclipse and API Tooling
OSGi, Eclipse and API Tooling
Lua on Steroids - EclipseCon NA 2012
Lua on Steroids - EclipseCon NA 2012
Mobile Development integration tests
Mobile Development integration tests
Managing Change
Managing Change
Migrating from PDE to Tycho builds
Migrating from PDE to Tycho builds
Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2
Building framework with shared code on Android and iOS using React Native. UA...
Building framework with shared code on Android and iOS using React Native. UA...
Os Grossupdated
Os Grossupdated
Java Programming (M&M)
Java Programming (M&M)
Similar to Discovering the p2 API
Discovery the p2 API (updated to Indigo)
Discovery the p2 API (updated to Indigo)
Pascal Rapicault
Open stack nova reverse engineer
Open stack nova reverse engineer
Vietnam Open Infrastructure User Group
Orion RESTful git API
Orion RESTful git API
Tomasz Zarna
What's new in p2 (2009)?
What's new in p2 (2009)?
Pascal Rapicault
ABC of Platform Workspace
ABC of Platform Workspace
Tomasz Zarna
Ubuntu Core 技术详解
Ubuntu Core 技术详解
Rex Tsai
Riena on-e4-ese2010
Riena on-e4-ese2010
christiancampo
Eclipse 3.7 : Tips and tricks
Eclipse 3.7 : Tips and tricks
Tomasz Zarna
[apidays LIVE HONK KONG] - OAS to Managed API in Seconds
[apidays LIVE HONK KONG] - OAS to Managed API in Seconds
WSO2
stackconf 2022: It’s Time to Debloat the Cloud with Unikraft
stackconf 2022: It’s Time to Debloat the Cloud with Unikraft
NETWAYS
Building Eclipse Plugins with Tycho
Building Eclipse Plugins with Tycho
jsievers
What Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOps
Matt Ray
한국통신학회 워크샵: SDN/NFV for Secure Services - Understanding Open Source SDN Contr...
한국통신학회 워크샵: SDN/NFV for Secure Services - Understanding Open Source SDN Contr...
Ian Choi
Webapps development on ubuntu
Webapps development on ubuntu
Xiaoguo Liu
Introduction to compose camps.pdf
Introduction to compose camps.pdf
AnkurAgarwal151093
CoreOS @ gluecon 2015
CoreOS @ gluecon 2015
ifup
Kolla - containerizing the cloud itself
Kolla - containerizing the cloud itself
Michal Rostecki
Kubernetes 101 - A Cluster Operating System
Kubernetes 101 - A Cluster Operating System
mikaelbarbero
How to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDK
Industrial Technology Research Institute (ITRI)(工業技術研究院, 工研院)
Isn’t it Ironic that a Redfish is software defining you
Isn’t it Ironic that a Redfish is software defining you
Bruno Cornec
Similar to Discovering the p2 API
(20)
Discovery the p2 API (updated to Indigo)
Discovery the p2 API (updated to Indigo)
Open stack nova reverse engineer
Open stack nova reverse engineer
Orion RESTful git API
Orion RESTful git API
What's new in p2 (2009)?
What's new in p2 (2009)?
ABC of Platform Workspace
ABC of Platform Workspace
Ubuntu Core 技术详解
Ubuntu Core 技术详解
Riena on-e4-ese2010
Riena on-e4-ese2010
Eclipse 3.7 : Tips and tricks
Eclipse 3.7 : Tips and tricks
[apidays LIVE HONK KONG] - OAS to Managed API in Seconds
[apidays LIVE HONK KONG] - OAS to Managed API in Seconds
stackconf 2022: It’s Time to Debloat the Cloud with Unikraft
stackconf 2022: It’s Time to Debloat the Cloud with Unikraft
Building Eclipse Plugins with Tycho
Building Eclipse Plugins with Tycho
What Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOps
한국통신학회 워크샵: SDN/NFV for Secure Services - Understanding Open Source SDN Contr...
한국통신학회 워크샵: SDN/NFV for Secure Services - Understanding Open Source SDN Contr...
Webapps development on ubuntu
Webapps development on ubuntu
Introduction to compose camps.pdf
Introduction to compose camps.pdf
CoreOS @ gluecon 2015
CoreOS @ gluecon 2015
Kolla - containerizing the cloud itself
Kolla - containerizing the cloud itself
Kubernetes 101 - A Cluster Operating System
Kubernetes 101 - A Cluster Operating System
How to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDK
Isn’t it Ironic that a Redfish is software defining you
Isn’t it Ironic that a Redfish is software defining you
Recently uploaded
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Anna Loughnan Colquhoun
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Gabriella Davis
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Neo4j
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Maria Levchenko
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Drew Madelung
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Product Anonymous
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
Enterprise Knowledge
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Rafal Los
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Radu Cotescu
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Enterprise Knowledge
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Michael W. Hawkins
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
hans926745
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Principled Technologies
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
Antenna Manufacturer Coco
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
HampshireHUG
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Delhi Call girls
Recently uploaded
(20)
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Discovering the p2 API
1.
Discovering the p2
API Pascal Rapicault Sonatype, p2 Lead © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 1
2.
Who are the
p2 committers? © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 2
3.
History 3.4 /
3.5 provisional API 3.6 / Helios is the first official release of the API © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 3
4.
3 levels of
API Graphical User Interface Headless Operations Core APIs + SPIs © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 4
5.
Graphical User Interface
GUI is SWT-based and designed to be reused in RCP / Eclipse applications. Ease of reuse: Add the p2.ui.sdk bundle, done (if you use IDE) . Add the p2.ui bundle, write a few extensions, done. org.eclipse.equinox.p2.ui org.eclipse.equinox.p2.ui.sdk © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 5
6.
Graphical User Interface
© Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 6
7.
Reusing individual UI
elements Most the pages / wizards can be reused Installed dialog Repository management License manager Install/Update/Uninstall wizard o.e.e.p2.ui.InstalledSoftwarePage o.e.e.p2.ui.RepositoryManipulationPage o.e.e.p2.ui.AcceptLicensesWizardPage o.e.e.p2.ui.ProvisioningUtil#open*Wizard org.eclipse.equinox.p2.ui © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 7
8.
Tweaking the existing
UI The Policy class Show / hide repository selection Drill down Show categories Content of the restart dialog … org.eclipse.equinox.p2.ui.Policy org.eclipse.equinox.p2.ui © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 8
9.
Tweaking the existing
UI © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 9
10.
More on UI
reuse See examples on the p2 wiki http://wiki.eclipse.org/Equinox/p2/Examples Susan’s and Steffen’s talk http://www.eclipsecon.org/2010/sessions/?page=sessions&id=1205 © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 10
11.
3 levels of
API Graphical User Interface Headless Operations Core APIs + SPIs © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 11
12.
Headless operations High
level operations to install / update / uninstall Focused on the Eclipse / OSGi use cases Encapsulates: Dependency resolution Download Modification of the system Restart org.eclipse.equinox.p2.operations org.eclipse.equinox.p2.operations © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 12
13.
Headless operations example
InstallOperation op = newInstallOperation(session, iusToInstall); if (op.resolveModal(newNullProgressMonitor()).isOK()) op.getProvisioningJob(newNullProgressMonitor()).schedule(); © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 13
14.
3 levels of
API Graphical User Interface Headless Operations Core APIs + SPIs © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 14
15.
Core concepts installable
unit/metadata query/ queryable planner repository agent engine profile registry/ profile © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 15
16.
Repositories p2 Update
Site Engine Eclipse/OSGi Native/OS Core concepts Metadata repo Artifact repo Data transfer Metadata fetched and constraints analyzed Transports Planner/Director Http/Https File system Volume Mirroring Provisioning operation requested IU install, uninstall, update operations Artifact availability and mirroring IUs configured into runtimes Profile updated Profile registry Runtimes © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 16
17.
How do I
get an IU? IUs can be obtained from Querying the metadata repository Querying the profile Querying … Programmatically created org.eclipse.equinox.p2.metadata.MetadataFactory org.eclipse.equinox.p2.metadata © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 17
18.
Queries / QueryableHow
do I query? What is queryable? Almost everything is queryable (repository, repository manager, profile, …) How do I create a query? QueryUtil.create* Domain specific queries (e.g. in eclipse.touchpoint) p2 QL, p2-specific query language http://wiki.eclipse.org/Query_Language_for_p2 org.eclipse.equinox.p2.query.IQueryable org.eclipse.equinox.p2.query.QueryUtil org.eclipse.equinox.p2.metadata org.eclipse.equinox.p2.ql © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 18
19.
The repository managerHow
do I get a repository? Artifact / metadata repository manager Addition / removal of repositories Enable / disable repositories Load Artifact / metadata repository Add Remove Query org.eclipse.equinox.p2.repository.IMetadataRepository org.eclipse.equinox.p2.repository.IArtifactRepository o.e.e.p2.repository.IMetadataRepositoryManager o.e.e.p2.repository.IArtifactRepositoryManager org.eclipse.equinox.p2.repository © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 19
20.
Provisioning agentHow do
I get a repository manager or p2 components? The agent groups related services together It is the starting point of everything. It is the executable version of the p2 area (e.g the p2 folder in the eclipse install) Several agents can run at once in one VM. Groups the services together. Allows to change some services (see implementations of IAgentServiceFactory) If you are only dealing with the running instance: Obtain the IProvisioningAgent service from the OSGi registry Create it using the IProvisioningContext#createAgent(null) org.eclipse.equinox.p2.core.IProvisioningAgent org.eclipse.equinox.p2.core.IProvisioningAgentProvider org.eclipse.equinox.p2.core © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 20
21.
Profile / profile
registryHow do I know what is installed? A profile is the complete description in terms of IUs of what is installed. The profile registry knows about all the profiles in a given p2 area org.eclipse.equinox.p2.engine.IProfile org.eclipse.equinox.p2.engine.IProfileRegistry org.eclipse.equinox.p2.engine org.eclipse.equinox.p2.engine © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 21
22.
What is not
API? Repository serialized format Layout of files on disk under the p2 folder © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 22
23.
Summary 3 levels
of API tailored for different needs Simple things should be simple Complex things should be possible This API is for YOU! Tell us what you think. © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 23
24.
Thank you mailto:p2-dev@eclipse.org
http://wiki.eclipse.org/Equinox/p2 © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 24
25.
Code snippet to
install © Sonatype, inc. All right reserved. Made available under Creative Commons Att. Nc Nd 2.5.license 25 ProvisioningSession session = null; //get the agent ServiceReferencesr = Activator.sContext.getServiceReference(IProvisioningAgentProvider.SERVICE_NAME); IProvisioningAgentProvideragentProvider = null; if (sr == null) return; agentProvider = (IProvisioningAgentProvider) Activator.sContext.getService(sr); IProvisioningAgent agent = agentProvider.createAgent(new URI("file:/Applications/eclipse63/p2")); //get the repo managers IMetadataRepositoryManager manager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME); IArtifactRepositoryManagerartifactManager = (IArtifactRepositoryManager) agent.getService(IArtifactRepositoryManager.SERVICE_NAME); //Loading reppos IMetadataRepositorymetadataRepo = manager.loadRepository(newURI("file:/Users/Pascal/tmp/demo/"), new NullProgressMonitor()); IArtifactRepositoryartifactRepo = artifactManager.loadRepository(newURI("file:/Users/Pascal/tmp/demo/"), new NullProgressMonitor()); //Querying Collection toInstall = metadataRepo.query(QueryUtil.createIUQuery("org.eclipse.equinox.p2.demo.feature.group"), new NullProgressMonitor()).toUnmodifiableSet(); InstallOperationinstallOperation = new InstallOperation(session, toInstall); if (installOperation.resolveModal(newNullProgressMonitor()).isOK()) installOperation.getProvisioningJob(newNullProgressMonitor()).schedule(); agent.close()
Download now