User: user57  
  Date: 02/01/03 16:18:51

  Modified:    src/main/org/jboss Version.java
  Log:
   o added some debugs to the Server init now that the BL doesn't show them
     unless the threshold is 1 or 0.  This will help debug boot problems
   o Exposed the build.date (build.day) properites
  
  Revision  Changes    Path
  1.5       +51 -21    jboss/src/main/org/jboss/Version.java
  
  Index: Version.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/Version.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Version.java      2001/12/05 23:45:09     1.4
  +++ Version.java      2002/01/04 00:18:51     1.5
  @@ -4,20 +4,22 @@
    * Distributable under LGPL license.
    * See terms of license at gnu.org.
    */
  +
   package org.jboss;
  -import java.io.IOException;
   
  +import java.io.IOException;
   import java.io.InputStream;
  +
   import java.util.Collections;
   import java.util.Map;
  -
   import java.util.Properties;
  +import java.util.Date;
   
   /**
  - *  Provides access to JBoss version (and build) properties.
  + * Provides access to JBoss version (and build) properties.
    *
    * @author     <a href="mailto:[EMAIL PROTECTED]";>Jason Dillon</a>
  - * @version    $Revision: 1.4 $
  + * @version    $Revision: 1.5 $
    */
   public final class Version
   {
  @@ -26,21 +28,23 @@
      public final static String VERSION_REVISION = "version.revision";
      public final static String VERSION_TAG = "version.tag";
      public final static String VERSION_NAME = "version.name";
  +
      public final static String BUILD_NUMBER = "build.number";
      public final static String BUILD_ID = "build.id";
  +   public final static String BUILD_DATE = "build.day";
   
      /**
  -    *  The single instance.
  +    * The single instance.
       */
      private static Version instance = null;
   
      /**
  -    *  The version properties.
  +    * The version properties.
       */
      private Properties props;
   
      /**
  -    *  Do not allow direct public construction.
  +    * Do not allow direct public construction.
       */
      private Version()
      {
  @@ -48,7 +52,7 @@
      }
   
      /**
  -    *  Get the single <tt>Version</tt> instance.
  +    * Get the single <tt>Version</tt> instance.
       *
       * @return    The single <tt>Version</tt> instance.
       */
  @@ -62,7 +66,7 @@
      }
   
      /**
  -    *  Returns an unmodifiable map of version properties.
  +    * Returns an unmodifiable map of version properties.
       *
       * @return    An unmodifiable map of version properties.
       */
  @@ -72,7 +76,7 @@
      }
   
      /**
  -    *  Returns the value for the given property name.
  +    * Returns the value for the given property name.
       *
       * @param     name - The name of the property.
       * @return    The property value or null if the property is not set.
  @@ -83,7 +87,7 @@
      }
   
      /**
  -    *  Returns the major number of the version.
  +    * Returns the major number of the version.
       *
       * @return    The major number of the version.
       */
  @@ -93,7 +97,7 @@
      }
   
      /**
  -    *  Returns the minor number of the version.
  +    * Returns the minor number of the version.
       *
       * @return    The minor number of the version.
       */
  @@ -103,7 +107,7 @@
      }
   
      /**
  -    *  Returns the revision number of the version.
  +    * Returns the revision number of the version.
       *
       * @return    The revision number of the version.
       */
  @@ -113,7 +117,7 @@
      }
   
      /**
  -    *  Returns the tag of the version.
  +    * Returns the tag of the version.
       *
       * @return    The tag of the version.
       */
  @@ -123,7 +127,7 @@
      }
   
      /**
  -    *  Returns the name number of the version.
  +    * Returns the name number of the version.
       *
       * @return    The name of the version.
       */
  @@ -133,7 +137,7 @@
      }
   
      /**
  -    *  Returns the build identifier for this version.
  +    * Returns the build identifier for this version.
       *
       * @return    The build identifier for this version.
       */
  @@ -143,7 +147,7 @@
      }
   
      /**
  -    *  Returns the build number for this version.
  +    * Returns the build number for this version.
       *
       * @return    The build number for this version.
       */
  @@ -153,8 +157,18 @@
      }
   
      /**
  -    *  Returns the version information as a string.
  +    * Returns the build date for this version.
       *
  +    * @return    The build date for this version.
  +    */
  +   public String getBuildDate()
  +   {
  +      return props.getProperty(BUILD_DATE);
  +   }
  +   
  +   /**
  +    * Returns the version information as a string.
  +    *
       * @return    Basic information as a string.
       */
      public String toString()
  @@ -186,8 +200,25 @@
         }
      }
   
  +   /**
  +    * Returns a property value as a long.
  +    *
  +    * @param    name - The name of the property.
  +    * @return   The property value, or -1 if there was a problem converting
  +    *           it to an long.
  +    */
  +   private long getLongProperty(final String name)
  +   {
  +      try {
  +         return Long.valueOf(props.getProperty(name)).longValue();
  +      }
  +      catch (Exception e) {
  +         return -1;
  +      }
  +   }
  +   
      /**
  -    *  Load the version properties from a resource.
  +    * Load the version properties from a resource.
       */
      private Properties loadProperties()
      {
  @@ -203,10 +234,9 @@
         }
         catch (IOException e)
         {
  -         throw new Error("missing version.properties");
  +         throw new Error("Missing version.properties");
         }
   
         return props;
      }
   }
  -
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to