Package org.osgi.service.subsystem

Examples of org.osgi.service.subsystem.SubsystemException


      if (subsystem.isScoped()) {
        RegionContextBundleHelper.uninstallRegionContextBundle(subsystem);
        activator.getRegionDigraph().removeRegion(subsystem.getRegion());
      }
      if (firstError != null)
        throw new SubsystemException(firstError);
    }
    finally {
      // Let's be sure to always clean up the directory.
      IOUtils.deleteRecursive(subsystem.getDirectory());
    }
View Full Code Here


 
  public synchronized void add(BasicSubsystem parent, BasicSubsystem child) {
    SubsystemWrapper parentWrap = new SubsystemWrapper(parent);
    SubsystemWrapper childWrap = new SubsystemWrapper(child);
    if (containsAncestor(childWrap, parentWrap))
      throw new SubsystemException("Cycle detected between '" + parentWrap + "' and '" + childWrap + "'");
    Collection<SubsystemWrapper> subsystems = adjacencyList.get(childWrap);
    if (subsystems == null) {
      subsystems = new HashSet<SubsystemWrapper>();
      adjacencyList.put(childWrap, subsystems);
    }
View Full Code Here

    InputStream is = ((RepositoryContent)resource).getContent();
    try {
      bundle = provisionTo.getRegion().installBundleAtLocation(getLocation(), is);
    }
    catch (BundleException e) {
      throw new SubsystemException(e);
    }
    finally {
      // Although Region.installBundle ultimately calls BundleContext.install,
      // which closes the input stream, an exception may occur before this
      // happens. Also, the Region API does not guarantee the stream will
View Full Code Here

        }
        catch (SubsystemException e) {
          throw e;
        }
        catch (Exception e) {
          throw new SubsystemException(e);
        }
      }
      else
        this.resource = resource;
      this.revision = revision;
View Full Code Here

      SubsystemContentHeader header = manifest.getSubsystemContentHeader();
      if (header == null)
        return;
      for (SubsystemContentHeader.Clause clause : header.getClauses()) {
        if (!clause.getVersionRange().isExact())
          throw new SubsystemException("Composite subsystem using version range for content: " + clause);
      }
    }
    else if (subsystem.isFeature()) {
      if (manifest.getSubsystemTypeHeader().getProvisionPolicyDirective().isAcceptDependencies())
        throw new SubsystemException("Feature subsystems may not declare a provision-policy of acceptDependencies");
      if (manifest.getHeaders().get(SubsystemConstants.PREFERRED_PROVIDER) != null)
        throw new SubsystemException("Feature subsystems may not declare a " + SubsystemConstants.PREFERRED_PROVIDER + " header");
    }
  }
View Full Code Here

    for (PreferredProviderHeader.Clause clause : header.getClauses()) {
      String type = (String)clause.getAttribute(PreferredProviderHeader.Clause.ATTRIBUTE_TYPE).getValue();
      if (!(SubsystemConstants.SUBSYSTEM_TYPE_COMPOSITE.equals(type) ||
          SubsystemConstants.SUBSYSTEM_TYPE_FEATURE.equals(type) ||
          Constants.ResourceTypeBundle.equals(type)))
        throw new SubsystemException("Unsupported " + PreferredProviderHeader.NAME + " type: " + type);
    }
  }
View Full Code Here

          // do nothing;
          return resource;
        }
      };
    }
      throw new SubsystemException("No installer exists for resource type: " + type);
  }
View Full Code Here

        || SubsystemConstants.SUBSYSTEM_TYPE_FEATURE.equals(type))
      return new SubsystemResourceUninstaller(resource, subsystem);
    else if (IdentityNamespace.TYPE_BUNDLE.equals(type) || IdentityNamespace.TYPE_FRAGMENT.equals(type))
      return new BundleResourceUninstaller(resource, subsystem);
    else
      throw new SubsystemException("No uninstaller exists for resource type: " + type);
  }
View Full Code Here

TOP

Related Classes of org.osgi.service.subsystem.SubsystemException

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.