geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r639504 - in /geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system: logging/log4j/Log4jService.java properties/JvmVendor.java
Date Fri, 21 Mar 2008 00:24:22 GMT
Author: dwoods
Date: Thu Mar 20 17:24:19 2008
New Revision: 639504

URL: http://svn.apache.org/viewvc?rev=639504&view=rev
Log:
GERONIMO-3900 - fix compile failure and rework where the string that gets logged in Log4jService
comes from, as suggested by Jarek.

Modified:
    geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java
    geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/JvmVendor.java

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java?rev=639504&r1=639503&r2=639504&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java
(original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java
Thu Mar 20 17:24:19 2008
@@ -629,15 +629,10 @@
           Log log = LogFactory.getLog(Log4jService.class);
           log.info("----------------------------------------------");
           log.info("Started Logging Service");
-          log.debug("Log4jService created with configFileName=" + this.configurationFile
+
-                    ", refreshPeriodSeconds=" + this.refreshPeriod);
+          log.debug("Log4jService created with configFileName=" + this.configurationFile
+ ", refreshPeriodSeconds=" + this.refreshPeriod);
           log.info("Runtime Information:");
           log.info("  Install Directory = " + DirectoryUtils.getGeronimoInstallDirectory().toString());
-          if (JvmVendor.isIBMHybrid()) {
-              log.info("  JVM in use = IBM Hybrid Java " + System.getProperty("java.version"));
-          } else {
-              log.info("  JVM in use = " + System.getProperty("java.vendor") + " Java " +
System.getProperty("java.version"));
-          }
+          log.info("  JVM in use = " + JvmVendor.getJvmInfo());
           log.info("Java Information:");
           log.info("  System property [java.runtime.name]  = " + System.getProperty("java.runtime.name"));
           log.info("  System property [java.runtime.version]  = " + System.getProperty("java.runtime.version"));

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/JvmVendor.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/JvmVendor.java?rev=639504&r1=639503&r2=639504&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/JvmVendor.java
(original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/JvmVendor.java
Thu Mar 20 17:24:19 2008
@@ -45,7 +45,7 @@
     static {
         String fullVendorName = getFullName();
         boolean bApache = fullVendorName.substring(0, 6).equalsIgnoreCase("Apache");    //
aka. Apache Harmony
-        boolean bIBM = fullVendorName.substring(0, 3)equalsIgnoreCase("IBM");           //
aka. IBM, but not IBM Hybrid
+        boolean bIBM = fullVendorName.substring(0, 3).equalsIgnoreCase("IBM");          
// aka. IBM, but not IBM Hybrid
         boolean bSun = !bIBM && !bApache;                                       
       // default all others to Sun
         boolean bHP = fullVendorName.substring(0, 7).equalsIgnoreCase("Hewlett");       //
aka. Hewlett-Packard Company
         boolean bIBMHybrid = false;
@@ -104,24 +104,7 @@
         ibmHybrid = bIBMHybrid;
         sun = bSun;
         // log what we found
-        if (ibmHybrid == true) {
-            if (System.getProperty("os.name").equalsIgnoreCase("SunOS") == true) {
-                log.info("IBM Hybrid SDK on SunOS detected");
-            } else if (System.getProperty("os.name").equalsIgnoreCase("HP-UX") == true) {
-                log.info("IBM Hybrid SDK on HP-UX detected");
-            } else {
-                log.error("Unknown IBM Hybrid SDK detected on " + System.getProperty("os.name"));
-            }
-        } else if (apache == true) {
-            log.info("Apache JVM detected - " + fullVendorName);
-        } else if (ibm == true) {
-            log.info("IBM JVM detected - " + fullVendorName);
-        } else if (sun == true) {
-            log.info("Sun JVM detected - " + fullVendorName);
-        } else {
-            // should never happen
-            log.warn("Unhandled JVM detected - " + getFullName());
-        }
+        log.info(getJvmInfo());
     }
 
     public static String getFullName() {
@@ -142,6 +125,21 @@
 
     public static boolean isApache() {
         return apache;
+    }
+
+    public static String getJvmInfo() {
+        if (sun == true) {
+            return new String("Sun JVM " + System.getProperty("java.version"));
+        } else if (apache == true) {
+            return new String("Apache Harmony JVM " + System.getProperty("java.version"));
+        } else if (ibm == true) {
+            return new String("IBM JVM " + System.getProperty("java.version"));
+        } else if (ibmHybrid == true) {
+            return new String("IBM Hybrid JVM " + System.getProperty("java.version") + "
on " + System.getProperty("os.name"));
+        } else {
+            // should never happen
+            return new String("Unknown JVM detected - " + getFullName());
+        }
     }
 
 }



Mime
View raw message