You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by rw...@apache.org on 2005/02/03 02:47:15 UTC

cvs commit: jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/tools/pamanager WarInfusionPAM.java

rwatler     2005/02/02 17:47:15

  Modified:    portal/src/java/org/apache/jetspeed/tools/pamanager
                        WarInfusionPAM.java
  Log:
  minimize deployer footprint in webapps during deploy and redeploy
  
  Revision  Changes    Path
  1.2       +38 -23    jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/tools/pamanager/WarInfusionPAM.java
  
  Index: WarInfusionPAM.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/tools/pamanager/WarInfusionPAM.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WarInfusionPAM.java	2 Feb 2005 03:12:36 -0000	1.1
  +++ WarInfusionPAM.java	3 Feb 2005 01:47:15 -0000	1.2
  @@ -237,11 +237,11 @@
           deleteDirectory(deployPortletAppDirectory);
           if (!deployPortletAppContextFile.exists() && !deployPortletAppDirectory.exists() && !deployPortletAppWarFile.exists())
           {
  -            log.info("Portlet application undeployment from " + deployPortletAppWarFile.getAbsolutePath() + " complete.");
  +            log.error("Portlet application undeployment of " + deployPortletAppWarFile.getAbsolutePath() + ", " + deployPortletAppContextFile.getAbsolutePath() + ", and/or " + deployPortletAppDirectory.getAbsolutePath() + " complete.");
           }
           else
           {
  -            log.error("Portlet application undeployment from " + deployPortletAppWarFile.getAbsolutePath() + " failed, unable to undeploy.");
  +            log.error("Portlet application undeployment of " + deployPortletAppWarFile.getAbsolutePath() + ", " + deployPortletAppContextFile.getAbsolutePath() + ", and/or " + deployPortletAppDirectory.getAbsolutePath() + " failed, unable to undeploy.");
           }
       }
           
  @@ -465,57 +465,72 @@
                   // undeploy any existing artifacts; move new portlet app
                   // context and expanded war file or war file into webapps
                   // container deployment directory as atomically as possible
  -                deployPortletAppWarFile.delete();
  -                deployPortletAppContextFile.delete();
  -                deleteDirectory(deployPortletAppDirectory);
  -                if (!deployPortletAppContextFile.exists() && !deployPortletAppDirectory.exists() && !deployPortletAppWarFile.exists())
  +                if (tempDeployPortletAppWarFile != null)
                   {
  -                    if (tempDeployPortletAppWarFile != null)
  +                    // undeploy and deploy portlet app war file
  +                    deployPortletAppWarFile.delete();
  +                    if (!deployPortletAppWarFile.exists())
                       {
  -                        // deploy portlet app war file
                           tempDeployPortletAppWarFile.renameTo(deployPortletAppWarFile);
                           if (deployPortletAppWarFile.exists())
                           {
  -                            log.info("Portlet application deployment to " + deployPortletAppWarFile.getAbsolutePath() + " complete.");
  +                            log.info("Portlet application deployment of " + deployPortletAppWarFile.getAbsolutePath() + " complete.");
                           }
                           else
                           {
  -                            log.error("Portlet application deployment to " + deployPortletAppWarFile.getAbsolutePath() + " failed, unable to deploy.");
  +                            log.error("Portlet application deployment of " + deployPortletAppWarFile.getAbsolutePath() + " failed, unable to deploy.");
                           }
                       }
  -                    else if ((tempDeployPortletAppContextFile != null) && (tempDeployPortletAppDirectory != null))
  +                    else
  +                    {
  +                        log.error("Portlet application deployment of " + deployPortletAppWarFile.getAbsolutePath() + " failed, unable to undeploy.");
  +                    }
  +                }
  +                else if ((tempDeployPortletAppContextFile != null) && (tempDeployPortletAppDirectory != null))
  +                {
  +                    // undeploy and deploy portlet app context.xml and expanded war file directory
  +                    deployPortletAppContextFile.delete();
  +                    deleteDirectory(deployPortletAppDirectory);
  +                    if (!deployPortletAppContextFile.exists() && !deployPortletAppDirectory.exists())
                       {
  -                        // deploy portlet app context.xml and expanded war file directory
                           tempDeployPortletAppContextFile.renameTo(deployPortletAppContextFile);
                           tempDeployPortletAppDirectory.renameTo(deployPortletAppDirectory);
                           if (deployPortletAppContextFile.exists() && deployPortletAppDirectory.exists())
                           {
  -                            log.info("Expanded portlet application deployment to " + deployPortletAppContextFile.getAbsolutePath() + " and " + deployPortletAppDirectory.getAbsolutePath() + " complete.");
  +                            log.info("Expanded portlet application deployment of " + deployPortletAppContextFile.getAbsolutePath() + " and " + deployPortletAppDirectory.getAbsolutePath() + " complete.");
                           }
                           else
                           {
                               deployPortletAppContextFile.delete();
                               deleteDirectory(deployPortletAppDirectory);
  -                            log.error("Expanded portlet application deployment to " + deployPortletAppContextFile.getAbsolutePath() + " and " + deployPortletAppDirectory.getAbsolutePath() + " failed, unable to deploy.");
  +                            log.error("Expanded portlet application deployment of " + deployPortletAppContextFile.getAbsolutePath() + " and " + deployPortletAppDirectory.getAbsolutePath() + " failed, unable to deploy.");
                           }
                       }
  -                    else if (tempDeployPortletAppDirectory != null)
  +                    else
  +                    {
  +                        log.error("Portlet application deployment of " + deployPortletAppContextFile.getAbsolutePath() + " and " + deployPortletAppDirectory.getAbsolutePath() + " failed, unable to undeploy.");
  +                    }
  +                }
  +                else if (tempDeployPortletAppDirectory != null)
  +                {
  +                    // undeploy and deploy portlet app expanded war file directory
  +                    deleteDirectory(deployPortletAppDirectory);
  +                    if (!deployPortletAppDirectory.exists())
                       {
  -                        // deploy portlet app expanded war file directory
                           tempDeployPortletAppDirectory.renameTo(deployPortletAppDirectory);
                           if (deployPortletAppDirectory.exists())
                           {
  -                            log.info("Expanded portlet application deployment to " + deployPortletAppDirectory.getAbsolutePath() + " complete.");
  +                            log.info("Expanded portlet application deployment of " + deployPortletAppDirectory.getAbsolutePath() + " complete.");
                           }
                           else
                           {
  -                            log.error("Expanded portlet application deployment to " + deployPortletAppDirectory.getAbsolutePath() + " failed, unable to deploy.");
  +                            log.error("Expanded portlet application deployment of " + deployPortletAppDirectory.getAbsolutePath() + " failed, unable to deploy.");
                           }
                       }
  -                }
  -                else
  -                {
  -                    log.error("Portlet application deployment to " + deployPortletAppWarFile.getAbsolutePath() + ", " + deployPortletAppContextFile.getAbsolutePath() + ", and/or " + deployPortletAppDirectory.getAbsolutePath() + " failed, unable to undeploy.");
  +                    else
  +                    {
  +                        log.error("Portlet application deployment of " + deployPortletAppDirectory.getAbsolutePath() + " failed, unable to undeploy.");
  +                    }
                   }
   
                   // do not complete registration synchronously: infused
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org