Package org.apache.aries.subsystem.core.archive

Examples of org.apache.aries.subsystem.core.archive.SubsystemManifest$Builder


    return getLocation().equals(that.getLocation());
  }
 
  @Override
  public List<Capability> getCapabilities(String namespace) {
    SubsystemManifest manifest = getSubsystemManifest();
    List<Capability> result = manifest.toCapabilities(this);
    if (namespace != null)
      for (Iterator<Capability> i = result.iterator(); i.hasNext();)
        if (!i.next().getNamespace().equals(namespace))
          i.remove();
    // TODO Somehow, exposing the capabilities of content resources of a
    // feature is causing an infinite regression of feature2 installations
    // in FeatureTest.testSharedContent() under certain conditions.
    if (isScoped() || IdentityNamespace.IDENTITY_NAMESPACE.equals(namespace))
      return result;
    SubsystemContentHeader header = manifest.getSubsystemContentHeader();
    for (Resource constituent : getConstituents())
      if (header.contains(constituent))
        for (Capability capability : constituent.getCapabilities(namespace))
          result.add(new BasicCapability(capability, this));
    return result;
View Full Code Here


    return result;
  }

  @Override
  public List<Requirement> getRequirements(String namespace) {
    SubsystemManifest manifest = getSubsystemManifest();
    List<Requirement> result = manifest.toRequirements(this);
    if (namespace != null)
      for (Iterator<Requirement> i = result.iterator(); i.hasNext();)
        if (!i.next().getNamespace().equals(namespace))
          i.remove();
    if (isScoped())
      return result;
    SubsystemContentHeader header = manifest.getSubsystemContentHeader();
    for (Resource constituent : getConstituents())
      if (header.contains(constituent))
        for (Requirement requirement : constituent.getRequirements(namespace))
          result.add(new BasicRequirement(requirement, this));
    return result;
View Full Code Here

  }
 
  synchronized SubsystemManifest getSubsystemManifest() {
    if (subsystemManifest == null) {
      try {
        subsystemManifest = new SubsystemManifest(directory.getFile("OSGI-INF/SUBSYSTEM.MF").open());
      }
      catch (Throwable t) {
        throw new SubsystemException(t);
      }
    }
View Full Code Here

 
  private static SubsystemManifest computeExistingSubsystemManifest(IDirectory directory) throws IOException {
    Manifest manifest = ManifestProcessor.obtainManifestFromAppDir(directory, "OSGI-INF/SUBSYSTEM.MF");
    if (manifest == null)
      return null;
    return new SubsystemManifest(manifest);
  }
View Full Code Here

  private static SubsystemManifest computeNewSubsystemManifest() {
    return new SubsystemManifest.Builder().build();
  }
 
  private static SubsystemManifest computeSubsystemManifest(IDirectory directory) throws IOException {
    SubsystemManifest result = computeExistingSubsystemManifest(directory);
    if (result == null)
      result = computeNewSubsystemManifest();
    return result;
  }
View Full Code Here

    this.location = new Location(location);
    if (content == null)
      content = this.location.open();
    try {
      resources = computeResources(content);
      SubsystemManifest manifest = computeSubsystemManifest(content);
      fakeImportServiceResource = createFakeResource(manifest);
      localRepository = computeLocalRepository();
      manifest = computeSubsystemManifestBeforeRequirements(manifest);
      requirements = computeRequirements(manifest);
      subsystemManifest = computeSubsystemManifestAfterRequirements(manifest);
View Full Code Here

  private SubsystemManifest initializeSubsystemManifest(IDirectory idir)
      throws IOException {
    Manifest manifest = ManifestProcessor.obtainManifestFromAppDir(idir,
        "OSGI-INF/SUBSYSTEM.MF");
    if (manifest != null)
      return new SubsystemManifest(manifest);
    else
      return new SubsystemManifest.Builder()
          .symbolicName(BasicSubsystem.ROOT_SYMBOLIC_NAME)
          .version(BasicSubsystem.ROOT_VERSION)
          .type(SubsystemTypeHeader.TYPE_APPLICATION
View Full Code Here

   * dependencies in addition to content for persistence purposes. This method
   * returns true only if the resource is "true" content of the subsystem and,
   * therefore, uses the Subsystem-Content header from the subsystem manifest.
   */
  public static boolean isContent(BasicSubsystem subsystem, Resource resource) {
    SubsystemManifest subsystemManifest = subsystem.getSubsystemManifest();
    if (subsystemManifest == null)
      return false;
    SubsystemContentHeader subsystemContentHeader = subsystemManifest.getSubsystemContentHeader();
    if (subsystemContentHeader == null)
      return false;
    return subsystemContentHeader.contains(resource);
  }
View Full Code Here

TOP

Related Classes of org.apache.aries.subsystem.core.archive.SubsystemManifest$Builder

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.