Package org.eclipse.equinox.p2.planner

Examples of org.eclipse.equinox.p2.planner.IPlanner


    // 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

          _builder_1.append("  ");
          _builder_1.append("<unit id=\"");
          String _id = iu.getId();
          _builder_1.append(_id, "  ");
          _builder_1.append("\" version=\"");
          Version _version = iu.getVersion();
          _builder_1.append(_version, "  ");
          _builder_1.append("\"/>");
          _builder_1.newLineIfNotEmpty();
        }
      }
View Full Code Here

                  final IQueryResult<IInstallableUnit> allVersions = metadataRepository.query(_createIUQuery, _newChild);
                  String _id_1 = it.getId();
                  Iterator<IInstallableUnit> _iterator = allVersions.iterator();
                  final Function1<IInstallableUnit, String> _function = new Function1<IInstallableUnit, String>() {
                    public String apply(final IInstallableUnit it) {
                      Version _version = it.getVersion();
                      return _version.toString();
                    }
                  };
                  Iterator<String> _map = IteratorExtensions.<IInstallableUnit, String>map(_iterator, _function);
                  String _join = IteratorExtensions.join(_map, ", ");
                  ICompletionProposal _createCompletionProposal = TargetPlatformProposalProvider.this.createCompletionProposal(_id_1, _join, TargetPlatformProposalProvider.IU, 0, context);
View Full Code Here

            SubMonitor _newChild_1 = wpm.newChild(5);
            IQueryResult<IInstallableUnit> _query = metadataRepository.query(_createIUQuery, _newChild_1);
            final Set<IInstallableUnit> results = _query.toUnmodifiableSet();
            final Procedure1<IInstallableUnit> _function = new Procedure1<IInstallableUnit>() {
              public void apply(final IInstallableUnit it) {
                Version _version = it.getVersion();
                Comparable<?> _segment = _version.getSegment(0);
                final Integer major = ((Integer) _segment);
                Version _version_1 = it.getVersion();
                Comparable<?> _segment_1 = _version_1.getSegment(1);
                final Integer minor = ((Integer) _segment_1);
                Version _version_2 = it.getVersion();
                Comparable<?> _segment_2 = _version_2.getSegment(2);
                final Integer micro = ((Integer) _segment_2);
                StringConcatenation _builder = new StringConcatenation();
                _builder.append(prefix, "");
                _builder.append("[");
                _builder.append(major, "");
                _builder.append(".");
                _builder.append(minor, "");
                _builder.append(".");
                _builder.append(micro, "");
                _builder.append(",");
                _builder.append(((major).intValue() + 1), "");
                _builder.append(".0.0)");
                StringConcatenation _builder_1 = new StringConcatenation();
                _builder_1.append("[");
                _builder_1.append(major, "");
                _builder_1.append(".");
                _builder_1.append(minor, "");
                _builder_1.append(".");
                _builder_1.append(micro, "");
                _builder_1.append(",");
                _builder_1.append(((major).intValue() + 1), "");
                _builder_1.append(".0.0)");
                Image _image = TargetPlatformProposalProvider.this.getImage(TargetPlatformProposalProvider.IU);
                ICompletionProposal _createCompletionProposal = TargetPlatformProposalProvider.this.createCompletionProposal(_builder.toString(), _builder_1.toString(), _image, context);
                acceptor.accept(_createCompletionProposal);
                StringConcatenation _builder_2 = new StringConcatenation();
                _builder_2.append(prefix, "");
                _builder_2.append("[");
                _builder_2.append(major, "");
                _builder_2.append(".");
                _builder_2.append(minor, "");
                _builder_2.append(".");
                _builder_2.append(micro, "");
                _builder_2.append(",");
                _builder_2.append(major, "");
                _builder_2.append(".");
                _builder_2.append(((minor).intValue() + 1), "");
                _builder_2.append(".0)");
                StringConcatenation _builder_3 = new StringConcatenation();
                _builder_3.append("[");
                _builder_3.append(major, "");
                _builder_3.append(".");
                _builder_3.append(minor, "");
                _builder_3.append(".");
                _builder_3.append(micro, "");
                _builder_3.append(",");
                _builder_3.append(major, "");
                _builder_3.append(".");
                _builder_3.append(((minor).intValue() + 1), "");
                _builder_3.append(".0)");
                Image _image_1 = TargetPlatformProposalProvider.this.getImage(TargetPlatformProposalProvider.IU);
                ICompletionProposal _createCompletionProposal_1 = TargetPlatformProposalProvider.this.createCompletionProposal(_builder_2.toString(), _builder_3.toString(), _image_1, context);
                acceptor.accept(_createCompletionProposal_1);
                StringConcatenation _builder_4 = new StringConcatenation();
                _builder_4.append(prefix, "");
                _builder_4.append("[");
                _builder_4.append(major, "");
                _builder_4.append(".");
                _builder_4.append(minor, "");
                _builder_4.append(".");
                _builder_4.append(micro, "");
                _builder_4.append(",");
                _builder_4.append(major, "");
                _builder_4.append(".");
                _builder_4.append(minor, "");
                _builder_4.append(".");
                _builder_4.append(((micro).intValue() + 1), "");
                _builder_4.append(")");
                StringConcatenation _builder_5 = new StringConcatenation();
                _builder_5.append("[");
                _builder_5.append(major, "");
                _builder_5.append(".");
                _builder_5.append(minor, "");
                _builder_5.append(".");
                _builder_5.append(micro, "");
                _builder_5.append(",");
                _builder_5.append(major, "");
                _builder_5.append(".");
                _builder_5.append(minor, "");
                _builder_5.append(".");
                _builder_5.append(((micro).intValue() + 1), "");
                _builder_5.append(")");
                Image _image_2 = TargetPlatformProposalProvider.this.getImage(TargetPlatformProposalProvider.IU);
                ICompletionProposal _createCompletionProposal_2 = TargetPlatformProposalProvider.this.createCompletionProposal(_builder_4.toString(), _builder_5.toString(), _image_2, context);
                acceptor.accept(_createCompletionProposal_2);
                StringConcatenation _builder_6 = new StringConcatenation();
                _builder_6.append(prefix, "");
                _builder_6.append("[");
                Version _version_3 = it.getVersion();
                _builder_6.append(_version_3, "");
                _builder_6.append(",");
                Version _version_4 = it.getVersion();
                _builder_6.append(_version_4, "");
                _builder_6.append("]");
                StringConcatenation _builder_7 = new StringConcatenation();
                _builder_7.append("[");
                Version _version_5 = it.getVersion();
                _builder_7.append(_version_5, "");
                _builder_7.append(",");
                Version _version_6 = it.getVersion();
                _builder_7.append(_version_6, "");
                _builder_7.append("]");
                Image _image_3 = TargetPlatformProposalProvider.this.getImage(TargetPlatformProposalProvider.IU);
                ICompletionProposal _createCompletionProposal_3 = TargetPlatformProposalProvider.this.createCompletionProposal(_builder_6.toString(), _builder_7.toString(), _image_3, context);
                acceptor.accept(_createCompletionProposal_3);
View Full Code Here

        public List<IInstallableUnit> listIUs(final URI location) {
          List<IInstallableUnit> _xifexpression = null;
          String _string = location.toString();
          boolean _equals = "http://location.org/p2".equals(_string);
          if (_equals) {
            Version _createOSGi = Version.createOSGi(1, 0, 0, "thequalifier");
            MockIU _mockIU = new MockIU("an.iu", _createOSGi);
            _xifexpression = CollectionLiterals.<IInstallableUnit>newImmutableList(_mockIU);
          } else {
            return CollectionLiterals.<IInstallableUnit>emptyList();
          }
View Full Code Here

TOP

Related Classes of org.eclipse.equinox.p2.planner.IPlanner

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.