Package org.eclipse.osgi.service.resolver

Examples of org.eclipse.osgi.service.resolver.State


      contextFinder = register(new String[] {ClassLoader.class.getName()}, tccl, props);
    }

    // Always call the adaptor.frameworkStart() at the end of this method.
    framework.adaptor.frameworkStart(bc);
    State state = framework.adaptor.getState();
    if (state instanceof StateImpl)
      ((StateImpl) state).setResolverHookFactory(new CoreResolverHookFactory((BundleContextImpl) context, framework.getServiceRegistry()));
    // attempt to resolve all bundles
    // this is done after the adaptor.frameworkStart has been called
    // this should be the first time the resolver State is accessed
View Full Code Here


        }
        ServiceReference ref = bundleContext.getServiceReference(PlatformAdmin.class.getName());
        PlatformAdmin platformAdmin = (PlatformAdmin) getService(PlatformAdmin.class, ref);

        try {
            State systemState = platformAdmin.getState(false);
            Iterator<Long> iterator = ids.iterator();
            while (iterator.hasNext()) {
                Long id = iterator.next();
                BundleDescription bundle = systemState.getBundle(id);
                if (bundle == null) {
                    System.err.println("Bundle ID" + id + " is invalid");
                    continue;
                }
                diagnose(bundle, platformAdmin);
View Full Code Here

        List<String> errors = new ArrayList<String>();
       
        ServiceReference ref = bundleContext.getServiceReference(PlatformAdmin.class.getName());
        try {
            PlatformAdmin platformAdmin = (PlatformAdmin) bundleContext.getService(ref);
            State systemState = platformAdmin.getState(false);
            List<BundleDescription> bundleDescriptions = new ArrayList<BundleDescription>(bundles.size());
            for (Bundle bundle : bundles) {
                BundleDescription bundleDescription = systemState.getBundle(bundle.getBundleId());
                if (bundleDescription != null) {
                    bundleDescriptions.add(bundleDescription);
                }
            }
            for (BundleDescription bundleDescription : bundleDescriptions) {
View Full Code Here

    Set<ResolverError> errors = new LinkedHashSet<ResolverError>();
    if (platformAdmin == null) {
      System.err.println("Could not acquire PlatformAdmin server");
      return errors;
    }
    State state = platformAdmin.getState(false /*mutable*/);
    if (state == null) {
      System.err.println("Resolver state is null");
      return errors;
    }
    BundleDescription description = state.getBundle(bundle.getBundleId());
    if (description == null) {
      System.err.println("Could not determine BundleDescription for " + bundle.toString());
    }
    getRelevantErrors(state, errors, description);
    return errors;
View Full Code Here

        List<ErrorDetail> errors = new ArrayList<ErrorDetail>();
       
        ServiceReference ref = bundleContext.getServiceReference(PlatformAdmin.class.getName());
        try {
            PlatformAdmin platformAdmin = (PlatformAdmin) bundleContext.getService(ref);
            State systemState = platformAdmin.getState(false);
            List<BundleDescription> bundleDescriptions = new ArrayList<BundleDescription>(bundles.size());
            for (Bundle bundle : bundles) {
                BundleDescription bundleDescription = systemState.getBundle(bundle.getBundleId());
                if (bundleDescription != null) {
                    bundleDescriptions.add(bundleDescription);
                }
            }
            for (BundleDescription bundleDescription : bundleDescriptions) {
View Full Code Here

  @SuppressWarnings("unchecked")
  private BundleDescription[] getPlugins(final IProduct prod)
  {
    final ArrayList list = new ArrayList();
    final State state = TargetPlatformHelper.getState();
    final IProductPlugin[] plugins = prod.getPlugins();
    for (int i = 0; i < plugins.length; i++)
    {
      final BundleDescription bundle = state.getBundle(plugins[i].getId(), null);
      if (bundle != null)
        list.add(bundle);
    }
    // implicitly add the new launcher plug-in/fragment if we are to use the
    // new launching story and the launcher plug-in/fragment are not already included in the .product file
View Full Code Here

    // Sort and make sure the wabs dependencies order.
    // Do not use Collections.sort(...)
    WebComActivator[] wabActArray = wabActivators
        .toArray(new WebComActivator[wabActivators.size()]);
    final State state = BundleServiceUtil.getPlatformAdmin()
        .getState(false);
    for (int i = 0; i < wabActArray.length;) {
      int lastMatched = i;
      for (int j = i + 1; j < wabActArray.length; j++) {
        boolean isBd1DependentBd2 = false;
        BundleDescription bundleDes1 = state.getBundle(wabActArray[i]
            .getBundle().getBundleId());
        BundleSpecification[] requiredBundleDeses = bundleDes1
            .getRequiredBundles();
        for (BundleSpecification bundleSpec : requiredBundleDeses) {
          BaseDescription supplier = bundleSpec.getSupplier();
View Full Code Here

   */
  public static Collection<BundleDescription> getRequiredBoudles(
      Bundle bundle, boolean includeOptional, boolean onlyReexported,
      boolean onlyDirectRequired) {
    // Need resolver.
    State platformState = getPlatformAdmin().getState(false);
    BundleDescription bundleDes = platformState.getBundle(bundle
        .getBundleId());
    return getResolvedRequiredBundles(bundleDes, includeOptional,
        onlyReexported, onlyDirectRequired);
  }
View Full Code Here

            return new Status(IStatus.ERROR, ScalaJDTWeavingPlugin.ID, "Could not find org.eclipse.equinox.weaving.aspectj" +
                " so weaving service cannot be " +
                (becomeEnabled ? "enabled" : "disabled") + ".");
        }
        try {
            State state = Platform.getPlatformAdmin().getState(false);
            if (becomeEnabled) {
                allEABundles[0].start();
                for (int i = 1; i < allEABundles.length; i++) {
                    allEABundles[i].stop();
                    BundleDescription desc = state.getBundle(allEABundles[i].getBundleId());
                    DisabledInfo info = new DisabledInfo(
                            "org.eclipse.contribution.weaving.jdt", //$NON-NLS-1$
                            "Disabled older version of Equinox Aspects", desc); //$NON-NLS-1$
                    try {
                        Platform.getPlatformAdmin().addDisabledInfo(info);
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.service.resolver.State

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.