1 23 package com.sun.enterprise.diagnostics.util; 24 25 import com.sun.enterprise.server.ServerContext; 26 import com.sun.enterprise.server.ApplicationServer; 27 31 public class DiagnosticServiceHelper { 32 33 public static final String OS_NAME="os.name"; 34 public static final String SUN ="sun"; 35 public static final String LINUX = "linux"; 36 37 public static String getInstallationRoot() { 38 return System.getProperty("com.sun.aas.installRoot"); 39 } 40 41 public static String getInstanceRoot() { 42 try { 43 return ApplicationServer.getServerContext().getInstallRoot(); 44 } catch (Exception e) { 45 return System.getProperty("com.sun.aas.instanceRoot"); 46 } 47 } 48 public static String getConfigLocation() { 49 return ApplicationServer.getServerContext().getServerConfigURL(); 50 } 51 52 public static String getInstanceName() { 53 return ApplicationServer.getServerContext().getInstanceName(); 54 } 55 56 public static boolean isSolaris() { 57 String osName = (System.getProperty(OS_NAME)).toLowerCase(); 58 59 if(osName.startsWith(SUN) || osName.startsWith(LINUX)) 60 return true; 61 return false; 62 } 63 64 } 65 | Popular Tags |