Package org.eclipse.equinox.p2.engine

Examples of org.eclipse.equinox.p2.engine.IProfile


    boolean _startsWith = _string.startsWith("bad");
    if (_startsWith) {
      String _string_1 = location.toString();
      String _plus = ("Bad location uri \'" + _string_1);
      String _plus_1 = (_plus + "\'");
      throw new ProvisionException(_plus_1);
    }
    return new MockMetadataRepository(location, this.resultProvider);
  }
View Full Code Here


        public IMetadataRepository loadRepository(final URI location, final IProgressMonitor monitor) throws ProvisionException, OperationCanceledException {
          IMetadataRepository _xifexpression = null;
          String _string = location.toString();
          boolean _equals = "unknownHost".equals(_string);
          if (_equals) {
            throw new ProvisionException("Unknown Host");
          } else {
            _xifexpression = super.loadRepository(location, monitor);
          }
          return _xifexpression;
        }
View Full Code Here

        boolean hasNoRepositoryFound = ((Boolean)invokePrivate(
              "hasNoRepositoryFound",
              new Class[]{IStatus.class},
              new Object[]{operationStatus})).booleanValue();
        if (noArtifactRepositorySpecified && hasNoRepositoryFound)
          throw new ProvisionException(Messages.Application_NoRepositories);
        throw new CoreException(operationStatus);
      }
    }
  }
View Full Code Here

    // EV: throw a regular Exception to account for reflection exceptions
    //throws CoreException
    throws Exception
  {
    // EV: pull some private vars in to local scope.
    IEngine engine = (IEngine)this.getPrivateField("engine");
    boolean verifyOnly = ((Boolean)this.getPrivateField("verifyOnly")).booleanValue();
    boolean noArtifactRepositorySpecified = ((Boolean)this.getPrivateField("noArtifactRepositorySpecified")).booleanValue();

    IStatus operationStatus;
    if (!verifyOnly) {
View Full Code Here

    // EV: invoke private methods
    //IProfile profile = initializeProfile();
    //Collection<IInstallableUnit> installs = collectRoots(profile, rootsToInstall, true);
    //Collection<IInstallableUnit> uninstalls = collectRoots(profile, rootsToUninstall, false);
    IProfile profile = (IProfile)
      invokePrivate("initializeProfile", new Class[0], new Object[0]);
    Collection<IInstallableUnit> installs = (Collection<IInstallableUnit>)
      invokePrivate("collectRoots",
          new Class[]{IProfile.class, List.class, Boolean.TYPE},
          new Object[]{profile, rootsToInstall, true});
    Collection<IInstallableUnit> uninstalls = (Collection<IInstallableUnit>)
      invokePrivate("collectRoots",
          new Class[]{IProfile.class, List.class, Boolean.TYPE},
          new Object[]{profile, rootsToUninstall, false});

    // keep this result status in case there is a problem so we can report it to the user
    boolean wasRoaming = Boolean.valueOf(profile.getProperty(IProfile.PROP_ROAMING)).booleanValue();
    try {
      // EV: invoke private methods
      //updateRoamingProperties(profile);
      invokePrivate("updateRoamingProperties",
          new Class[]{IProfile.class}, new Object[]{profile});

      // EV: pull in private fields
      IProvisioningAgent targetAgent = (IProvisioningAgent)this.getPrivateField("targetAgent");
      List<URI> metadataRepositoryLocations = (List<URI>)this.getPrivateField("metadataRepositoryLocations");
      List<URI> artifactRepositoryLocations = (List<URI>)this.getPrivateField("artifactRepositoryLocations");
      boolean followReferences = ((Boolean)this.getPrivateField("followReferences")).booleanValue();
      String FOLLOW_ARTIFACT_REPOSITORY_REFERENCES = (String)this.getPrivateField("FOLLOW_ARTIFACT_REPOSITORY_REFERENCES");

      ProvisioningContext context = new ProvisioningContext(targetAgent);
      context.setMetadataRepositories(metadataRepositoryLocations.toArray(new URI[metadataRepositoryLocations.size()]));
      context.setArtifactRepositories(artifactRepositoryLocations.toArray(new URI[artifactRepositoryLocations.size()]));
      context.setProperty(ProvisioningContext.FOLLOW_REPOSITORY_REFERENCES, String.valueOf(followReferences));
      context.setProperty(FOLLOW_ARTIFACT_REPOSITORY_REFERENCES, String.valueOf(followReferences));

      // EV: invoke private methods
      //ProfileChangeRequest request = buildProvisioningRequest(profile, installs, uninstalls);
      //printRequest(request);
      ProfileChangeRequest request = (ProfileChangeRequest)
        invokePrivate("buildProvisioningRequest",
            new Class[]{IProfile.class, Collection.class, Collection.class},
            new Object[]{profile, installs, uninstalls});
      invokePrivate(
          "printRequest",
          new Class[]{ProfileChangeRequest.class},
          new Object[]{request});

      planAndExecute(profile, context, request);
    } finally {
      // if we were originally were set to be roaming and we changed it, change it back before we return
      if (wasRoaming && !Boolean.valueOf(profile.getProperty(IProfile.PROP_ROAMING)).booleanValue())
        // EV: invoke private method
        //setRoaming(profile);
        invokePrivate("setRoaming", new Class[]{IProfile.class}, new Object[]{profile});
    }
  }
View Full Code Here

        this.workbench = workbench;
        this.agent = (IProvisioningAgent) getService(IProvisioningAgent.class, IProvisioningAgent.SERVICE_NAME);

        IProfileRegistry profileRegistry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME);

        IProfile profile = profileRegistry.getProfile(IProfileRegistry.SELF);
        if (profile == null)
        {
            IStatus status = new Status(IStatus.ERROR, PortfolioPlugin.PLUGIN_ID, Messages.MsgNoProfileFound);
            throw new CoreException(status);
        }
View Full Code Here

    public UpdateHelper(IWorkbench workbench) throws CoreException
    {
        this.workbench = workbench;
        this.agent = (IProvisioningAgent) getService(IProvisioningAgent.class, IProvisioningAgent.SERVICE_NAME);

        IProfileRegistry profileRegistry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME);

        IProfile profile = profileRegistry.getProfile(IProfileRegistry.SELF);
        if (profile == null)
        {
            IStatus status = new Status(IStatus.ERROR, PortfolioPlugin.PLUGIN_ID, Messages.MsgNoProfileFound);
            throw new CoreException(status);
        }
View Full Code Here

    throws Exception
  {
    // EV: pull some private vars in to local scope.
    IPlanner planner = (IPlanner)this.getPrivateField("planner");

    IProvisioningPlan result = planner.getProvisioningPlan(
        request, context, new NullProgressMonitor());
    IStatus operationStatus = result.getStatus();
    if (!operationStatus.isOK())
      throw new CoreException(operationStatus);
    executePlan(context, result);
  }
View Full Code Here

      List<URI> metadataRepositoryLocations = (List<URI>)this.getPrivateField("metadataRepositoryLocations");
      List<URI> artifactRepositoryLocations = (List<URI>)this.getPrivateField("artifactRepositoryLocations");
      boolean followReferences = ((Boolean)this.getPrivateField("followReferences")).booleanValue();
      String FOLLOW_ARTIFACT_REPOSITORY_REFERENCES = (String)this.getPrivateField("FOLLOW_ARTIFACT_REPOSITORY_REFERENCES");

      ProvisioningContext context = new ProvisioningContext(targetAgent);
      context.setMetadataRepositories(metadataRepositoryLocations.toArray(new URI[metadataRepositoryLocations.size()]));
      context.setArtifactRepositories(artifactRepositoryLocations.toArray(new URI[artifactRepositoryLocations.size()]));
      context.setProperty(ProvisioningContext.FOLLOW_REPOSITORY_REFERENCES, String.valueOf(followReferences));
      context.setProperty(FOLLOW_ARTIFACT_REPOSITORY_REFERENCES, String.valueOf(followReferences));

      // EV: invoke private methods
      //ProfileChangeRequest request = buildProvisioningRequest(profile, installs, uninstalls);
      //printRequest(request);
      ProfileChangeRequest request = (ProfileChangeRequest)
View Full Code Here

        if (monitor.isCanceled()) {
          break;
        }
        Set<IInstallableUnit> results = metadataRepository.query(iu.getQuery(), loopMonitor.newChild(1)).toUnmodifiableSet();
        if (!results.isEmpty()) {
          IInstallableUnit unit =  results.iterator().next();
          if (iu.isLazyRange() && unit instanceof InstallableUnit) {
            ((InstallableUnit)unit).setVersion(Version.create("0.0.0"));
          }
          resolvedIUs.add(unit);
        } else {
View Full Code Here

TOP

Related Classes of org.eclipse.equinox.p2.engine.IProfile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.