Package org.jboss.ejb3.packagemanager.exception

Examples of org.jboss.ejb3.packagemanager.exception.PackageManagerException


   @Override
   public void installPackage(String pkgPath, InstallOptions installOptions) throws PackageManagerException
   {
      if (pkgPath == null)
      {
         throw new PackageManagerException("Package path is null");
      }
      URL packageURL = null;
      try
      {
         packageURL = this.getPackageURL(pkgPath);
      }
      catch (MalformedURLException mue)
      {
         throw new PackageManagerException("Cannot parse path " + pkgPath, mue);
      }
      this.installPackage(packageURL, installOptions);
     
   }
View Full Code Here


   @Override
   public void installPackage(URL packageURL, InstallOptions installOptions) throws PackageManagerException
   {
      if (packageURL == null)
      {
         throw new PackageManagerException("Package URL is null");
      }

      // create a package context
      PackageContext pkgCtx = new DefaultPackageContext(this.pkgMgrCtx, packageURL);
      this.installPackage(pkgCtx, installOptions);
View Full Code Here

    */
   protected void installPackage(PackageContext pkgContext, InstallOptions installOptions) throws PackageManagerException
   {
      if (pkgContext == null)
      {
         throw new PackageManagerException("Package context is null");
      }

      // check if package is already installed
      boolean packageAlreadyInstalled = this.pkgDatabaseManager.isPackageInstalled(pkgContext.getPackageName());
      if (packageAlreadyInstalled)
      {
         throw new PackageManagerException("Package " + pkgContext + " is already installed");
      }
      logger.debug("New package " + pkgContext + " being installed");
      // proceed with installation of the package

      if (pkgContext.getInstallationFiles() == null)
      {
         throw new PackageManagerException("There are no files to install for package: " + pkgContext);
      }
      // work on dependencies first (because if deps are not satisfied then no point
      // running the pre-install step.
      // BUT, think about this (should we first run pre-install and then deps?).
      // What would be a ideal behaviour?
View Full Code Here

         // check if other packages are dependent on this package
         // If yes, then do NOT remove this package. Else remove this package
         Set<PersistentPackage> dependentPackages = this.pkgDatabaseManager.getDependentPackages(packageName);
         if (dependentPackages != null && !dependentPackages.isEmpty())
         {
            throw new PackageManagerException("Other packages are dependent on package " + packageName
                  + " - cannot remove this package!");
         }
      }
      // pre-uninstall step
      this.preUnInstallPackage(installedPackage);
View Full Code Here

   @Override
   public void updatePackage(String packageFilePath, UpgradeOptions upgradeOptions) throws PackageManagerException
   {
      if (packageFilePath == null)
      {
         throw new PackageManagerException("Package path is null");
      }
      URL packageURL = null;
      try
      {
         packageURL = this.getPackageURL(packageFilePath);
      }
      catch (MalformedURLException mue)
      {
         throw new PackageManagerException("Cannot parse path " + packageFilePath, mue);
      }
      this.updatePackage(packageURL, upgradeOptions);
     
   }
View Full Code Here

   @Override
   public void updatePackage(URL packageURL, UpgradeOptions upgradeOptions) throws PackageManagerException
   {
      if (packageURL == null)
      {
         throw new PackageManagerException("Package URL is null");
      }

      // create a package context
      PackageContext pkgCtx = new DefaultPackageContext(this.pkgMgrCtx, packageURL);
      this.updatePackage(pkgCtx, upgradeOptions);     
View Full Code Here

         path = new File(root, script.getPath());
      }
      File scriptFile = new File(path, scriptFileName);
      if (!scriptFile.exists())
      {
         throw new PackageManagerException("Script file " + scriptFile + " for " + pkgCtx + " does not exist!");
      }
      try
      {
         File destFile = new File(destDir, scriptFile.getName());
         IOUtil.copy(scriptFile, destFile);
         logger.debug("Stored script file " + scriptFile + " at " + destDir);
      }
      catch (IOException e)
      {
         throw new PackageManagerException("Could not store script due to exception ", e);
      }
   }
View Full Code Here

            path = new File(root, script.getPath());
         }
         File scriptFile = new File(path, scriptFileName);
         if (!scriptFile.exists())
         {
            throw new PackageManagerException("Script file " + scriptFile + " for " + pkgCtx + " does not exist!");
         }
         scriptProcessor.processPreInstallScript(this.pkgMgrCtx, pkgCtx, scriptFile);
      }

   }
View Full Code Here

         File packageManagerHome = this.pkgMgrCtx.getPackageManagerEnvironment().getPackageManagerHome();
         File scriptFileLocation = new File(packageManagerHome, script.getPath());
         File scriptFile = new File(scriptFileLocation, script.getName());
         if (!scriptFile.exists())
         {
            throw new PackageManagerException("Script file " + scriptFile + " for package "
                  + installedPackage.getPackageName() + " does not exist!");
         }
         scriptProcessor.processPreUnInstallScript(this.pkgMgrCtx, installedPackage, scriptFile);
      }
View Full Code Here

            path = new File(root, script.getPath());
         }
         File scriptFile = new File(path, scriptFileName);
         if (!scriptFile.exists())
         {
            throw new PackageManagerException("Script file " + scriptFile + " for " + pkgCtx + " does not exist!");
         }
         scriptProcessor.processPostInstallScript(this.pkgMgrCtx, pkgCtx, scriptFile);

      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.packagemanager.exception.PackageManagerException

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.