KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > container > monitor > jvm > J2EEServerInfo


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.container.monitor.jvm;
6
7 /**
8  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
9  * @since Nov 8, 2004
10  * @version $Id$
11  */

12 public class J2EEServerInfo {
13   private String JavaDoc serverName_ ;
14   private String JavaDoc serverHome_ ;
15   protected String JavaDoc sharedLibDirecotry_ ;
16   protected String JavaDoc appDeployDirecotry_ ;
17   
18   public J2EEServerInfo() {
19     String JavaDoc catalinaHome = System.getProperty("catalina.home");
20     String JavaDoc jbossHome = System.getProperty("jboss.home.dir");
21     String JavaDoc jettyHome = System.getProperty("jetty.home");
22     String JavaDoc websphereHome = System.getProperty("was.install.root");
23     String JavaDoc weblogicHome = System.getProperty("weblogic.Name");
24     String JavaDoc 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 JavaDoc("unknown server platform") ;
39     }
40   }
41   
42   public String JavaDoc getServerName() { return serverName_ ; }
43   
44   public String JavaDoc getServerHome() { return serverHome_ ; }
45   
46   public String JavaDoc getSharedLibDirectory() { return sharedLibDirecotry_ ; }
47   
48   public String JavaDoc getApplicationDeployDirectory() { return appDeployDirecotry_ ; }
49 }
50
Popular Tags