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 StandardServer.java
Date Mon, 04 Oct 2004 13:26:47 GMT
remm        2004/10/04 06:26:47

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardServer.java
  Log:
  - Fix save-to-XML for naming resources.
  
  Revision  Changes    Path
  1.38      +49 -4     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardServer.java
  
  Index: StandardServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardServer.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- StandardServer.java	17 Sep 2004 21:58:25 -0000	1.37
  +++ StandardServer.java	4 Oct 2004 13:26:47 -0000	1.38
  @@ -34,6 +34,7 @@
   import java.net.Socket;
   import java.security.AccessControlException;
   import java.sql.Timestamp;
  +import java.util.Iterator;
   import java.util.Random;
   
   import javax.management.MBeanRegistration;
  @@ -172,9 +173,9 @@
        * components, and hence should not be persisted.
        */
       private static String standardImplementations[] = {
  +        "org.apache.catalina.connector.Connector",
           "org.apache.catalina.core.StandardServer",
           "org.apache.catalina.core.StandardService",
  -        "org.apache.coyote.tomcat5.CoyoteConnector",
           "org.apache.catalina.core.StandardEngine",
           "org.apache.catalina.core.StandardHost",
           "org.apache.catalina.core.StandardContext",
  @@ -1128,8 +1129,12 @@
               // Open an output writer for the new configuration file
               writer = null;
               try {
  +                File parent = config.getParentFile();
  +                if ((parent != null) && (!parent.exists())) {
  +                    parent.mkdirs();
  +                }
                   writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(config),
"UTF8"));
  -            } catch (IOException e) {
  +            } catch (Exception e) {
                   if (writer != null) {
                       try {
                           writer.close();
  @@ -1557,6 +1562,16 @@
                   }
                   writer.print("<Ejb");
                   storeAttributes(writer, false, ejbs[i]);
  +                Iterator properties = ejbs[i].listProperties();
  +                while (properties.hasNext()) {
  +                    String name = (String) properties.next();
  +                    writer.print(' ');
  +                    writer.print(name);
  +                    writer.print("=\"");
  +                    String strValue = convertStr((String) ejbs[i].getProperty(name));
  +                    writer.print(strValue);
  +                    writer.print("\"");
  +                }
                   writer.println("/>");
               }
           }
  @@ -1583,6 +1598,16 @@
                   }
                   writer.print("<LocalEjb");
                   storeAttributes(writer, false, lejbs[i]);
  +                Iterator properties = lejbs[i].listProperties();
  +                while (properties.hasNext()) {
  +                    String name = (String) properties.next();
  +                    writer.print(' ');
  +                    writer.print(name);
  +                    writer.print("=\"");
  +                    String strValue = convertStr((String) lejbs[i].getProperty(name));
  +                    writer.print(strValue);
  +                    writer.print("\"");
  +                }
                   writer.println("/>");
               }
           }
  @@ -1595,6 +1620,16 @@
               }
               writer.print("<Resource");
               storeAttributes(writer, false, dresources[i]);
  +            Iterator properties = dresources[i].listProperties();
  +            while (properties.hasNext()) {
  +                String name = (String) properties.next();
  +                writer.print(' ');
  +                writer.print(name);
  +                writer.print("=\"");
  +                String strValue = convertStr((String) dresources[i].getProperty(name));
  +                writer.print(strValue);
  +                writer.print("\"");
  +            }
               writer.println("/>");
           }
   
  @@ -1606,7 +1641,17 @@
               }
               writer.println("<ResourceEnvRef");
               storeAttributes(writer, false, eresources[i]);
  -            writer.println("</ResourceEnvRef>");
  +            Iterator properties = eresources[i].listProperties();
  +            while (properties.hasNext()) {
  +                String name = (String) properties.next();
  +                writer.print(' ');
  +                writer.print(name);
  +                writer.print("=\"");
  +                String strValue = convertStr((String) eresources[i].getProperty(name));
  +                writer.print(strValue);
  +                writer.print("\"");
  +            }
  +            writer.println("/>");
           }
   
           // Store nested <ResourceLink> elements
  
  
  

---------------------------------------------------------------------
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