Package org.apache.aries.application.modelling

Examples of org.apache.aries.application.modelling.ModelledResourceManager


        this.resolver = resolver;
      }
    }
    else if (service instanceof ModelledResourceManager) {
      if (service.equals(modelledResourceManager)) {
        ModelledResourceManager modelledResourceManager = (ModelledResourceManager)findAlternateServiceFor(this.modelledResourceManager);
        if (modelledResourceManager == null)
          deactivate();
        this.modelledResourceManager = modelledResourceManager;
      }
    }
View Full Code Here


    return revision.getRequirements(namespace);
  }
 
  private ModelledResource computeModelledResource() {
    Activator activator = Activator.getInstance();
    ModelledResourceManager manager = activator.getModelledResourceManager();
    BundleDirectory directory = new BundleDirectory(revision.getBundle());
    try {
      return manager.getModelledResource(directory);
    }
    catch (ModellerException e) {
      throw new SubsystemException(e);
    }
  }
View Full Code Here

                  .attribute(IMPORT_PACKAGE, extraImport)
                  .attribute(EXPORT_PACKAGE, "a.pack.age")
              .end().writeOut(fout);
      fout.close();     
     
      ModelledResourceManager mrm = context().getService(ModelledResourceManager.class);
      ModelledResource aBundle = mrm.getModelledResource(FileSystem.getFSRoot(new File("a.bundle.jar")));
      ModelledResource bBundle = mrm.getModelledResource(FileSystem.getFSRoot(new File("b.bundle.jar")));
     
      AriesApplicationResolver resolver = context().getService(AriesApplicationResolver.class);
      return resolver.resolveInIsolation("test.app", "1.0.0",
              Arrays.asList(aBundle, bBundle),
              Arrays.<Content>asList(ContentFactory.parseContent("a.bundle", "1.0.0"), ContentFactory.parseContent("b.bundle", "1.0.0")));
View Full Code Here

  private void generateOBRRepoXML(String ... bundleFiles) throws Exception
  {
    Set<ModelledResource> mrs = new HashSet<ModelledResource>();
    FileOutputStream fout = new FileOutputStream("repository.xml");
    RepositoryGenerator repositoryGenerator = context().getService(RepositoryGenerator.class);
    ModelledResourceManager modelledResourceManager = context().getService(ModelledResourceManager.class);
    for (String fileName : bundleFiles) {
      File bundleFile = new File(fileName);
      IDirectory jarDir = FileSystem.getFSRoot(bundleFile);
      mrs.add(modelledResourceManager.getModelledResource(bundleFile.toURI().toString(), jarDir));
    }
    repositoryGenerator.generateRepository("Test repo description", mrs, fout);
    fout.close();
    }
View Full Code Here

  private void generateOBRRepoXML(boolean nullURI, String ... bundleFiles) throws Exception
  {
    Set<ModelledResource> mrs = new HashSet<ModelledResource>();
    FileOutputStream fout = new FileOutputStream("repository.xml");
    RepositoryGenerator repositoryGenerator = context().getService(RepositoryGenerator.class);
    ModelledResourceManager modelledResourceManager = context().getService(ModelledResourceManager.class);
    for (String fileName : bundleFiles) {
      File bundleFile = new File(fileName);
      IDirectory jarDir = FileSystem.getFSRoot(bundleFile);
      String uri = "";
      if (!!!nullURI) {
        uri = bundleFile.toURI().toString();
      }
      if ("delete.jar".equals(fileName)) {
        jarDir = null;
      }
      mrs.add(modelledResourceManager.getModelledResource(uri, jarDir));
    }
    repositoryGenerator.generateRepository("Test repo description", mrs, fout);
    fout.close();
  }
View Full Code Here

  private void generateOBRRepoXML(boolean nullURI, String ... bundleFiles) throws Exception
  {
    Set<ModelledResource> mrs = new HashSet<ModelledResource>();
    FileOutputStream fout = new FileOutputStream("repository.xml");
    RepositoryGenerator repositoryGenerator = getOsgiService(RepositoryGenerator.class);
    ModelledResourceManager modelledResourceManager = getOsgiService(ModelledResourceManager.class);
    for (String fileName : bundleFiles) {
      File bundleFile = new File(fileName);
      IDirectory jarDir = FileSystem.getFSRoot(bundleFile);
      String uri = "";
      if (!!!nullURI) {
        uri = bundleFile.toURI().toString();
      }
      mrs.add(modelledResourceManager.getModelledResource(uri, jarDir));
    }
    repositoryGenerator.generateRepository("Test repo description", mrs, fout);
    fout.close();
  }
View Full Code Here

  private void generateOBRRepoXML(String ... bundleFiles) throws Exception
  {
    Set<ModelledResource> mrs = new HashSet<ModelledResource>();
    FileOutputStream fout = new FileOutputStream("repository.xml");
    RepositoryGenerator repositoryGenerator = getOsgiService(RepositoryGenerator.class);
    ModelledResourceManager modelledResourceManager = getOsgiService(ModelledResourceManager.class);
    for (String fileName : bundleFiles) {
      File bundleFile = new File(fileName);
      IDirectory jarDir = FileSystem.getFSRoot(bundleFile);
      mrs.add(modelledResourceManager.getModelledResource(bundleFile.toURI().toString(), jarDir));
    }
    repositoryGenerator.generateRepository("Test repo description", mrs, fout);
    fout.close();
    }
View Full Code Here

TOP

Related Classes of org.apache.aries.application.modelling.ModelledResourceManager

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.