tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core ContainerBase.java
Date Fri, 03 Dec 2004 15:39:31 GMT
remm        2004/12/03 07:39:31

  Modified:    catalina/src/share/org/apache/catalina/core
                        ContainerBase.java
  Log:
  - Experiment with adding child to the map before starting it (and removing it if there's
a problem).
  
  Revision  Changes    Path
  1.38      +9 -1      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/ContainerBase.java
  
  Index: ContainerBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/ContainerBase.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- ContainerBase.java	5 Oct 2004 17:12:50 -0000	1.37
  +++ ContainerBase.java	3 Dec 2004 15:39:31 -0000	1.38
  @@ -750,16 +750,24 @@
                                                      child.getName() +
                                                      "' is not unique");
               child.setParent(this);  // May throw IAE
  +            children.put(child.getName(), child);
  +
  +            // Start child
               if (started && (child instanceof Lifecycle)) {
  +                boolean success = false;
                   try {
                       ((Lifecycle) child).start();
  +                    success = true;
                   } catch (LifecycleException e) {
                       log.error("ContainerBase.addChild: start: ", e);
                       throw new IllegalStateException
                           ("ContainerBase.addChild: start: " + e);
  +                } finally {
  +                    if (!success) {
  +                        children.remove(child.getName());
  +                    }
                   }
               }
  -            children.put(child.getName(), child);
   
               fireContainerEvent(ADD_CHILD_EVENT, child);
           }
  
  
  

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


Mime
View raw message