[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] IDirector and IEngine

Hi, Eugen.
I think it depends on the nature of your GUI.

The p2 UI rarely calls the director because we almost always involve the user in confirmation of the plan or other decision making.
In our case, we build the plan, show the user what will happen, possibly correct the plan for the user, and then invoke the engine.

Something like...

ProfileChangeRequest req = new ProfileChangeRequest(profile);
ProvisioningPlan plan = planner.getProvisioningPlan(req, null, null);
// validate the plan...get confirmation from the user or report a problem...
// Might want to change the original request based on the input
// Once we know the plan is approved by the user and is OK...
engine.perform(profile, new DefaultPhaseSet(), plan.getOperands(), null, null);

For an example of building and/or changing the plan, take a look at this static method in InstallAction. It does things like figure out that the user really means to upgrade when they pick an IU for install and other changes in the original request.
computeProvisioningPlan(IInstallableUnit[] ius, String targetProfileId, IProgressMonitor monitor):

In headless situations, you see a lot more use of the director to carry out the whole operation since the user doesn't get a chance to modify the request.

Inactive hide details for Eugen Reiswich <reiswich@xxxxxx>Eugen Reiswich <reiswich@xxxxxx>

          Eugen Reiswich <reiswich@xxxxxx>
          Sent by: p2-dev-bounces@xxxxxxxxxxx

          09/10/2008 12:57 PM
          Please respond to P2 developer discussions

To: P2 developer discussions <p2-dev@xxxxxxxxxxx>
Subject: Re: [p2-dev] IDirector and IEngine

Sorry John, didn't see that. So if I got it right I only invoke operations on the IDirector and he will delegate all further steps to the IEngine. Hence I should never use the IEngine directly, right?


Am 10.09.2008 um 20:19 schrieb John Arthorne:
p2-dev mailing list

GIF image

GIF image

GIF image