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

Examples of org.apache.aries.subsystem.core.archive.SubsystemContentHeader


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


      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

    Coordination coordination = Activator.getInstance()
        .getCoordinator()
        .create(target.getSymbolicName() + '-' + target.getSubsystemId(), 0);
    try {
      List<Resource> resources = new ArrayList<Resource>(Activator.getInstance().getSubsystems().getResourcesReferencedBy(target));
      SubsystemContentHeader header = target.getSubsystemManifest().getSubsystemContentHeader();
      if (header != null)
        Collections.sort(resources, new StartResourceComparator(header));
      for (Resource resource : resources)
        startResource(resource, coordination);
      target.setState(State.ACTIVE);
View Full Code Here

  }
 
  private List<Requirement> computeRequirements(SubsystemManifest manifest) throws ResolutionException {
    if (isComposite(manifest))
      return manifest.toRequirements(this);
    SubsystemContentHeader header = manifest.getSubsystemContentHeader();
    if (header == null)
      return Collections.emptyList();
    // TODO Need the system repository in here. Preferred provider as well?
    LocalRepository localRepo = new LocalRepository(resources);
    RepositoryServiceRepository serviceRepo = new RepositoryServiceRepository(Activator.getInstance().getBundleContext());
    CompositeRepository compositeRepo = new CompositeRepository(localRepo, serviceRepo);
    List<Requirement> requirements = header.toRequirements(this);
    List<Resource> resources = new ArrayList<Resource>(requirements.size());
    for (Requirement requirement : requirements) {
      Collection<Capability> capabilities = compositeRepo.findProviders(requirement);
      if (capabilities.isEmpty())
        continue;
View Full Code Here

    result.trimToSize();
    return result;
  }
 
  private SubsystemContentHeader computeSubsystemContentHeader(SubsystemManifest manifest) {
    SubsystemContentHeader header = manifest.getSubsystemContentHeader();
    if (header == null && !resources.isEmpty())
      header = SubsystemContentHeader.newInstance(resources);
    return header;
  }
View Full Code Here

      waitForStateChange();
      return new StopAction(requestor, target, disableRootCheck).run();
    }
    target.setState(State.STOPPING);
    List<Resource> resources = new ArrayList<Resource>(Activator.getInstance().getSubsystems().getResourcesReferencedBy(target));
    SubsystemContentHeader header = target.getSubsystemManifest().getSubsystemContentHeader();
    if (header != null) {
      Collections.sort(resources, new StartResourceComparator(target.getSubsystemManifest().getSubsystemContentHeader()));
      Collections.reverse(resources);
    }
    for (Resource resource : resources) {
View Full Code Here

      }
    }
  }
 
  private void computeContentResources(SubsystemManifest manifest) throws BundleException, IOException, InvalidSyntaxException, URISyntaxException {
    SubsystemContentHeader contentHeader = manifest.getSubsystemContentHeader();
    if (contentHeader == null)
      return;
    for (SubsystemContentHeader.Clause clause : contentHeader.getClauses()) {
      Requirement requirement = clause.toRequirement(this);
      Resource resource = findContent(requirement);
      if (resource == null) {
        if (clause.isMandatory())
          throw new SubsystemException("Resource does not exist: "+ requirement);
View Full Code Here

      }
    } 
  }
 
  private void computeDependencies(SubsystemManifest manifest) {
    SubsystemContentHeader contentHeader = manifest.getSubsystemContentHeader();
    try {
      Map<Resource, List<Wire>> resolution = Activator.getInstance().getResolver().resolve(createResolveContext());
      for (Resource resource : resolution.keySet())
        if (!contentHeader.contains(resource))
          addDependency(resource);
    }
    catch (ResolutionException e) {
      throw new SubsystemException(e);
    }
View Full Code Here

  private boolean isInstallable(Resource resource) {
    return !isShared(resource);
  }
 
  private boolean isMandatory(Resource resource) {
    SubsystemContentHeader header = this.resource.getSubsystemManifest().getSubsystemContentHeader();
    if (header == null)
      return false;
    return header.isMandatory(resource);
  }
View Full Code Here

   */
  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.SubsystemContentHeader

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.