Package org.eclipse.equinox.region

Examples of org.eclipse.equinox.region.Region


  }
 
  private static void setExportIsolationPolicy(BasicSubsystem subsystem) throws InvalidSyntaxException, IOException, BundleException, URISyntaxException, ResolutionException {
    if (!subsystem.isComposite())
      return;
    Region from = ((BasicSubsystem)subsystem.getParents().iterator().next()).getRegion();
    Region to = subsystem.getRegion();
    RegionFilterBuilder builder = from.getRegionDigraph().createRegionFilterBuilder();
    setExportIsolationPolicy(builder, subsystem.getDeploymentManifest().getExportPackageHeader(), subsystem);
    setExportIsolationPolicy(builder, subsystem.getDeploymentManifest().getProvideCapabilityHeader(), subsystem);
    setExportIsolationPolicy(builder, subsystem.getDeploymentManifest().getSubsystemExportServiceHeader(), subsystem);
    RegionFilter regionFilter = builder.build();
View Full Code Here


 
  private void handleExplicitlyInstalledBundleRegionDigraph(Bundle origin, BundleRevision bundleRevision) {
      // The bundle needs to be associated with the scoped subsystem of
      // the region used to install the bundle.
      RegionDigraph digraph = activator.getRegionDigraph();
      Region region = digraph.getRegion(origin);
      for (BasicSubsystem s : getSubsystems().getSubsystems()) {
        if ((s.isApplication() || s.isComposite())
            && region.equals(s.getRegion())) {
          Utils.installResource(bundleRevision, s);
          return;
        }
      }
      throw new IllegalStateException("No subsystem found for bundle " + bundleRevision + " in region " + region);
View Full Code Here

            .append("))").toString());
  }
 
  private void addSubsystemServiceImportToSharingPolicy(RegionFilterBuilder builder, Region to)
      throws InvalidSyntaxException, BundleException, IOException, URISyntaxException {
    Region root = Activator.getInstance().getSubsystems().getRootSubsystem().getRegion();
    if (to.getName().equals(root.getName()))
      addSubsystemServiceImportToSharingPolicy(builder);
    else {
      to = root;
      builder = to.getRegionDigraph().createRegionFilterBuilder();
      addSubsystemServiceImportToSharingPolicy(builder);
View Full Code Here

        + getSubsystemManifest().getSubsystemVersionHeader()
            .getVersion()
        + ';'
        + getSubsystemManifest().getSubsystemTypeHeader()
            .getType() + ';' + Long.toString(id);
    Region region = digraph.getRegion(name);
    // TODO New regions need to be cleaned up if this subsystem fails to
    // install, but there's no access to the coordination here.
    if (region == null)
      return digraph.createRegion(name);
    return region;
View Full Code Here

  }
 
  private boolean isValid(Capability capability, Requirement requirement) throws BundleException, IOException, InvalidSyntaxException, URISyntaxException {
    if (IdentityNamespace.IDENTITY_NAMESPACE.equals(capability.getNamespace()))
      return true;
    Region from = findRegionForCapabilityValidation(capability.getResource());
    Region to = findRegionForCapabilityValidation(requirement.getResource());
    return new SharingPolicyValidator(from, to).isValid(capability);
  }
View Full Code Here

  }
 
  private void setImportIsolationPolicy() throws BundleException, IOException, InvalidSyntaxException, URISyntaxException {
    if (isRoot() || !isScoped())
      return;
    Region region = getRegion();
    Region from = region;
    RegionFilterBuilder builder = from.getRegionDigraph().createRegionFilterBuilder();
    Region to = ((BasicSubsystem)getParents().iterator().next()).getRegion();
    addSubsystemServiceImportToSharingPolicy(builder, to);
    // TODO Is this check really necessary? Looks like it was done at the beginning of this method.
    if (isScoped()) {
      // Both applications and composites have Import-Package headers that require processing.
      // In the case of applications, the header is generated.
View Full Code Here

  }
 
  public void addRequirements(Collection<? extends Requirement> requirements) throws BundleException, InvalidSyntaxException {
    for (int i = 0; i < MAX_ATTEMPTS_DEFAULT; i++) {
      RegionDigraph copy = copyDigraph();
      Region tail = copyTail(copy);
      Region head = copyHead(copy);
      Set<Long> bundleIds = copyBundleIds(tail);
      Map<String, RegionFilterBuilder> heads = copyHeadRegions(tail, copy);
      Map<String, RegionFilterBuilder> tails = copyTailRegions(tail, copy);
      copy.removeRegion(tail);
      tail = copy.createRegion(tail.getName());
      addBundleIds(bundleIds, tail);
      addRequirements(requirements, heads.get(head.getName()));
      addHeadRegions(heads, tail, copy);
      addTailRegions(tails, tail, copy);
      // Replace the current digraph.
      try {
        digraph.replace(copy);
View Full Code Here

        } else {
            bundles = true;
            filters = true;
            namespaces = true;
            for (String regionName : regions) {
                Region region = regionDigraph.getRegion(regionName);
                if (region == null) {
                    System.out.println("No region " + regionName);
                } else {
                    showRegion(region);
                }
View Full Code Here

    @Argument(index = 1, name = "bundles", description = "Bundles by id to add to the region", required = true, multiValued = true)
    List<Long> ids;

    protected void doExecute(RegionDigraph regionDigraph) throws Exception {
        Region r = getRegion(regionDigraph, region);
        for (Long id : ids) {
            for (Region existing: regionDigraph.getRegions()) {
                if (existing.contains(id)) {
                    Bundle b = getBundleContext().getBundle(id);
                    System.out.println("Removing bundle " + id + " from region " + existing.getName());
                    existing.removeBundle(b);
                    break;
                }
            }
            r.addBundle(id);
        }
    }
View Full Code Here

        load();
    }

    @Override
    public void install(Bundle b, String regionName) throws BundleException {
        Region region = regionDigraph.getRegion(regionName);
        if (region == null) {
            region = regionDigraph.createRegion(regionName);
        }
        kernel.removeBundle(b);
        region.addBundle(b);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.equinox.region.Region

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.