1 5 package org.exoplatform.container.monitor.jvm; 6 7 12 public class J2EEServerInfo { 13 private String serverName_ ; 14 private String serverHome_ ; 15 protected String sharedLibDirecotry_ ; 16 protected String appDeployDirecotry_ ; 17 18 public J2EEServerInfo() { 19 String catalinaHome = System.getProperty("catalina.home"); 20 String jbossHome = System.getProperty("jboss.home.dir"); 21 String jettyHome = System.getProperty("jetty.home"); 22 String websphereHome = System.getProperty("was.install.root"); 23 String weblogicHome = System.getProperty("weblogic.Name"); 24 String standAlone = System.getProperty("maven.exoplatform.dir") ; 25 if (catalinaHome != null) { 26 serverName_= "tomcat" ; serverHome_ = catalinaHome ; 27 } else if (jbossHome != null) { 28 serverName_= "jboss" ; serverHome_ = jbossHome ; 29 } else if (jettyHome != null) { 30 serverName_= "tomcat" ; serverHome_ = jettyHome ; 31 } else if (websphereHome != null) { 32 serverName_= "websphere" ; serverHome_ = websphereHome ; 33 } else if (weblogicHome != null) { 34 serverName_= "weblogic" ; serverHome_ = weblogicHome ; 35 } else if (standAlone != null) { 36 serverName_= "standalone" ; serverHome_ = standAlone ; 37 } else { 38 throw new UnsupportedOperationException ("unknown server platform") ; 39 } 40 } 41 42 public String getServerName() { return serverName_ ; } 43 44 public String getServerHome() { return serverHome_ ; } 45 46 public String getSharedLibDirectory() { return sharedLibDirecotry_ ; } 47 48 public String getApplicationDeployDirectory() { return appDeployDirecotry_ ; } 49 } 50 | Popular Tags |