Package uk.co.brunella.osgi.bdt.repository

Examples of uk.co.brunella.osgi.bdt.repository.Deployer


    }
    File repositoryDirectory = new File(repositoryDir);
    if (!checkRepository(repositoryDirectory)) {
      return false;
    }
    Deployer deployer = new Deployer(repositoryDirectory);
    deployer.deploy(bundleFile);
    System.out.println("Deployed bundle " + bundleFile + " to repository " + repositoryDirectory);
    return true;
  }
View Full Code Here


  private static boolean undeploy(String bundleSymbolicName, String bundleVersion, String repositoryDir) throws IOException {
    File repositoryDirectory = new File(repositoryDir);
    if (!checkRepository(repositoryDirectory)) {
      return false;
    }
    Deployer deployer = new Deployer(repositoryDirectory);
    Version version = Version.parseVersion(bundleVersion);
    deployer.undeploy(bundleSymbolicName, version, true);
    System.out.println("Undeployed bundle " + bundleSymbolicName + " version " + version.toString() +
        " from repository " + repositoryDirectory);
    return true;
  }
View Full Code Here

    return new BundleRepositoryPersister(repositoryDirectory).checkRepository();
  }

  private static boolean create(String repositoryDir, String profile) throws IOException {
    File repositoryDirectory = new File(repositoryDir);
    Deployer deployer = new Deployer(repositoryDirectory);
    deployer.create(profile);
    return true;
  }
View Full Code Here

  private static boolean list(String repositoryDir) throws IOException {
    File repositoryDirectory = new File(repositoryDir);
    if (!checkRepository(repositoryDirectory)) {
      return false;
    }
    Deployer deployer = new Deployer(repositoryDirectory);
    List<BundleDescriptor> bundles = deployer.list();
   
    for (BundleDescriptor descriptor : bundles) {
      System.out.println(descriptor.getBundleSymbolicName() + " " + descriptor.getBundleVersion() +
          " [" + descriptor.getBundleJarFileName() + "]" );
    }
View Full Code Here

    setTaskName("osgi-deploy");
    setDescription("Deploys a bundle to the bundle repository");
  }

  public void execute() {
    Deployer deployer = new Deployer(repository);
    deployer.setVerbose(verbose);
   
    if (bundle != null) {
      deployFile(deployer, bundle);
    }
   
View Full Code Here

    setTaskName("osgi-create");
    setDescription("Creates a new bundle repository");
  }
 
  public void execute() {
    Deployer deployer = new Deployer(repository);
    deployer.setVerbose(verbose);
    try {
      deployer.create(profileName);
      log(deployer.getLogMessages());
    } catch (IOException e) {
      throw new BuildException("Creation of repository failed: " + e.getMessage());
    } catch (Throwable t) {
      t.printStackTrace();
      throw new BuildException(t.getMessage());
View Full Code Here

    setTaskName("osgi-undeploy");
    setDescription("Undeploys a bundle from the bundle repository");
  }

  public void execute() {
    Deployer deployer = new Deployer(repository);
    deployer.setVerbose(verbose);
    version = version.trim();
    range = range.trim();
    if (version.length() > 0 && range.length() > 0) {
      throw new BuildException("Only version or range can be set not both");
    }
    try {
      if (version.length() > 0) {
        Version bundleVersion = Version.parseVersion(version);
        deployer.undeploy(bundleName, bundleVersion, true);
      } else {
        VersionRange bundleVersionRange = VersionRange.parseVersionRange(range);
        deployer.undeploy(bundleName, bundleVersionRange, true);
      }
      log(deployer.getLogMessages());
    } catch (IOException e) {
      throw new BuildException("Undeployment of bundle failed: " + e.getMessage());
    } catch (Throwable t) {
      throw new BuildException(t.getMessage());
    }
View Full Code Here

  public void execute() {
    if (verbose) {
      System.out.println("Listing repository in " + repository);
    }
    Deployer deployer = new Deployer(repository);
    try {
      List<BundleDescriptor> bundles = deployer.list();
      for (BundleDescriptor descriptor : bundles) {
        System.out.println(descriptor.getBundleSymbolicName() + " " + descriptor.getBundleVersion() +
            " [" + descriptor.getBundleJarFileName() + "]");
        if (verbose) {
          System.out.println("Export-Package:");
View Full Code Here

                return;
              }
            }
            NewRepositoryDialog newDialog = new NewRepositoryDialog(getShell(), directory);
            if (newDialog.open() == IDialogConstants.OK_ID) {
              Deployer deployer = new Deployer(repositoryDirectory);
              try {
                deployer.create(newDialog.getProfileName());
                addRepositoryPath(directory);
                contentProvider.refresh();
                viewer.refresh();
              } catch (IOException e) {
                MessageDialog.openError(getShell(), "Add repository", "Could not create repository\n" + e.getMessage());
View Full Code Here

      this.repositoryDirectory = repositoryDirectory;
      this.bundleJars = bundleJars;
    }

    public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      Deployer deployer = new Deployer(repositoryDirectory);
      try {
        for (String bundleJar : bundleJars) {
          deployer.deploy(new File(bundleJar));
        }
        contentProvider.refresh();
      } catch (IOException e) {
        throw new InvocationTargetException(e);
      }
View Full Code Here

TOP

Related Classes of uk.co.brunella.osgi.bdt.repository.Deployer

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.