Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 189995 Details for
Bug 337016
[operations] Simplify operation API to cater for self case
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Pascal's AbsoluteInstallOperation from the mailing list
AbsoluteInstallOperation.java (text/x-java), 3.13 KB, created by
Dave Orme
on 2011-02-28 15:42:36 EST
(
hide
)
Description:
Pascal's AbsoluteInstallOperation from the mailing list
Filename:
MIME Type:
Creator:
Dave Orme
Created:
2011-02-28 15:42:36 EST
Size:
3.13 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2011 Sonatype, Inc. and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: > * Sonatype, Inc. - initial API and implementation > *******************************************************************************/ >package org.eclipse.equinox.p2.operations; > >import java.util.Collection; >import org.eclipse.core.runtime.*; >import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest; >import org.eclipse.equinox.internal.p2.operations.Messages; >import org.eclipse.equinox.p2.engine.IProfile; >import org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery; >import org.eclipse.equinox.p2.metadata.IInstallableUnit; >import org.eclipse.equinox.p2.planner.ProfileInclusionRules; >import org.eclipse.equinox.p2.query.QueryUtil; > >/** > * A {@link AbsoluteInstallOperation} describes an operation that will modify the installation to > * exclusively include the InstallableUnit mentioned. Note that all the Installable Units necessary > * to satisfy the dependencies of the Installable Units installed will also be installed. > * > * The following snippet shows how one might use an AbsoluteInstallOperation to perform a synchronous resolution and > * then kick off an install in the background: > * > * <pre> > * AbsoluteInstallOperation op = new AbsoluteInstallOperation(session, new IInstallableUnit [] { myIU }); > * IStatus result = op.resolveModal(monitor); > * if (result.isOK()) { > * op.getProvisioningJob(monitor).schedule(); > * } > * </pre> > * > * @since 2.1 > * @see ProfileChangeOperation > * @noextend This class is not intended to be subclassed by clients. > */ >public class AbsoluteInstallOperation extends InstallOperation { > > public AbsoluteInstallOperation(ProvisioningSession session, Collection<IInstallableUnit> toInstall) { > super(session, toInstall); > } > > /* > * (non-Javadoc) > * @see org.eclipse.equinox.p2.operations.ProfileChangeOperation#computeProfileChangeRequest(org.eclipse.core.runtime.MultiStatus, org.eclipse.core.runtime.IProgressMonitor) > */ > protected void computeProfileChangeRequest(MultiStatus status, IProgressMonitor monitor) { > request = ProfileChangeRequest.createByProfileId(session.getProvisioningAgent(), profileId); > IProfile profile; > SubMonitor sub = SubMonitor.convert(monitor, Messages.InstallOperation_ComputeProfileChangeProgress, toInstall.size()); > profile = session.getProfileRegistry().getProfile(profileId); > request.removeAll(profile.query(new UserVisibleRootQuery(), sub).toUnmodifiableSet()); > request.addAll(toInstall); > for (IInstallableUnit entryToInstall : toInstall) { > // If the user is installing a patch, we mark it optional. This allows the patched IU to be updated later by removing the patch. > if (QueryUtil.isPatch(entryToInstall)) > request.setInstallableUnitInclusionRules(entryToInstall, ProfileInclusionRules.createOptionalInclusionRule(entryToInstall)); > > sub.worked(1); > } > sub.done(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 337016
:
188826
|
189995
|
193604
|
193772
|
194659
|
194662