tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util ServerInfo.java ServerInfo.properties
Date Fri, 24 Sep 2004 16:40:50 GMT
mturk       2004/09/24 09:40:50

  Modified:    catalina/src/share/org/apache/catalina/util ServerInfo.java
                        ServerInfo.properties
  Log:
  Add server built and version number to ServerInfo.
  It just makes '-version' more informative.
  
  Revision  Changes    Path
  1.4       +48 -3     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/ServerInfo.java
  
  Index: ServerInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/ServerInfo.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServerInfo.java	30 Jun 2004 15:25:31 -0000	1.3
  +++ ServerInfo.java	24 Sep 2004 16:40:50 -0000	1.4
  @@ -41,6 +41,16 @@
        */
       private static String serverInfo = null;
   
  +    /**
  +     * The server built String.
  +     */
  +    private static String serverBuilt = null;
  +
  +    /**
  +     * The server's version number String.
  +     */
  +    private static String serverNumber = null;
  +
       static {
   
           try {
  @@ -50,12 +60,18 @@
               props.load(is);
               is.close();
               serverInfo = props.getProperty("server.info");
  +            serverBuilt = props.getProperty("server.built");
  +            serverNumber = props.getProperty("server.number");
           } catch (Throwable t) {
               ;
           }
           if (serverInfo == null)
               serverInfo = "Apache Tomcat";
  -
  +        if (serverBuilt == null)
  +            serverBuilt = "unknown";
  +        if (serverNumber == null)
  +            serverNumber = "5.5.0.0";
  +        
       }
   
   
  @@ -71,9 +87,38 @@
   
       }
   
  +    /**
  +     * Return the server built time for this version of Tomcat.
  +     */
  +    public static String getServerBuilt() {
  +
  +        return (serverBuilt);
  +
  +    }
  +
  +    /**
  +     * Return the server's version number.
  +     */
  +    public static String getServerNumber() {
  +
  +        return (serverNumber);
  +
  +    }
   
       public static void main(String args[]) {
  -        System.out.println("Version: " + getServerInfo());
  +        System.out.println("Server version: " + getServerInfo());
  +        System.out.println("Server built:   " + getServerBuilt());
  +        System.out.println("Server number:  " + getServerNumber());
  +        System.out.println("OS Name:        " +
  +                           System.getProperty("os.name"));
  +        System.out.println("OS Version:     " +
  +                           System.getProperty("os.version"));
  +        System.out.println("Architecture:   " +
  +                           System.getProperty("os.arch"));
  +        System.out.println("JVM Version:    " +
  +                           System.getProperty("java.runtime.version"));
  +        System.out.println("JVM Vendor:     " +
  +                           System.getProperty("java.vm.vendor"));                     
  
       }
   
   }
  
  
  
  1.2       +2 -0      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/ServerInfo.properties
  
  Index: ServerInfo.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/ServerInfo.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServerInfo.properties	18 Jul 2002 16:47:46 -0000	1.1
  +++ ServerInfo.properties	24 Sep 2004 16:40:50 -0000	1.2
  @@ -1 +1,3 @@
   server.info=Apache Tomcat/@VERSION@
  +server.number=@VERSION_NUMBER@
  +server.built=@VERSION_BUILT@
  \ No newline at end of file
  
  
  

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