remm        2004/09/02 03:15:53

  Modified:    catalina/src/share/org/apache/catalina/startup
                        HostConfig.java
  Log:
  - Also check if the webapp has been statically defined somewhere. In that case, the 
auto deployer should ignore it (at least until it's
    removed from the host).
  
  Revision  Changes    Path
  1.44      +17 -5     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java
  
  Index: HostConfig.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- HostConfig.java   4 Aug 2004 06:48:07 -0000       1.43
  +++ HostConfig.java   2 Sep 2004 10:15:53 -0000       1.44
  @@ -549,7 +549,7 @@
       protected void deployDescriptor(String contextPath, File contextXml, String 
file) {
           DeployedApplication deployedApp = new DeployedApplication(contextPath);
           
  -        if (deployed.containsKey(contextPath))
  +        if (deploymentExists(contextPath))
               return;
   
           // Assume this is a configuration descriptor and deploy it
  @@ -680,9 +680,11 @@
        * @param file
        */
       protected void deployWAR(String contextPath, File dir, String file) {
  -        if (deployed.containsKey(contextPath))
  +        
  +        if (deploymentExists(contextPath))
               return;
  -       // Checking for a nested /META-INF/context.xml
  +        
  +        // Checking for a nested /META-INF/context.xml
           JarFile jar = null;
           JarEntry entry = null;
           InputStream istream = null;
  @@ -857,7 +859,7 @@
       protected void deployDirectory(String contextPath, File dir, String file) {
           DeployedApplication deployedApp = new DeployedApplication(contextPath);
           
  -        if (deployed.containsKey(contextPath))
  +        if (deploymentExists(contextPath))
               return;
   
           // Deploy the application in this directory
  @@ -888,6 +890,16 @@
           deployed.put(contextPath, deployedApp);
       }
   
  +    
  +    /**
  +     * Check if a webapp is already deployed in this host.
  +     * 
  +     * @param contextPath of the context which will be checked
  +     */
  +    protected boolean deploymentExists(String contextPath) {
  +        return (deployed.containsKey(contextPath) || (host.findChild(contextPath) 
!= null));
  +    }
  +    
   
       /**
        * Add watched resources to the specified Context.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to