incubator-lokahi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tob...@apache.org
Subject svn commit: r422734 - in /incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi: core/agent/jmx/JMXTomcat.java tomcat/api/worker/TomcatWorkerModel.java
Date Mon, 17 Jul 2006 14:50:52 GMT
Author: toback
Date: Mon Jul 17 07:50:51 2006
New Revision: 422734

URL: http://svn.apache.org/viewvc?rev=422734&view=rev
Log:
Update such that the agent and console use the http port to refer to jvms.

Modified:
    incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/jmx/JMXTomcat.java
    incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/api/worker/TomcatWorkerModel.java

Modified: incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/jmx/JMXTomcat.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/jmx/JMXTomcat.java?rev=422734&r1=422733&r2=422734&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/jmx/JMXTomcat.java
(original)
+++ incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/jmx/JMXTomcat.java
Mon Jul 17 07:50:51 2006
@@ -49,9 +49,18 @@
   private HashMap<String, String> env = new HashMap<String, String>();
 
   public void setEnvironment(String s) {
-    while (!"".equals(s.trim())) {
-      env.put(s.substring(0, s.indexOf('=') - 1), s.substring(s.indexOf('='), s.indexOf(';')
- 1));
-      s = s.substring(s.indexOf(';'));
+    if (s!=null) {
+  	  try {
+    	while (!"".equals(s.trim())) {
+    		env.put(s.substring(0, s.indexOf('=') - 1), s.substring(s.indexOf('='), s.indexOf(';')
- 1));
+    		s = s.substring(s.indexOf(';'));
+    	}
+	  }
+	  catch(Exception e){
+		  if (logger.isInfoEnabled()) {
+		        logger.info("Exception: " + e.getMessage());
+		  }
+	  }
     }
   }
 
@@ -129,6 +138,11 @@
         if (jvm instanceof JMXTomcat && name.equals(jvm.getVmName())) {
           t = (JMXTomcat) jvm;
         }
+      }
+      if (t == null) { // todo makesure that this is a jmxtomcat
+    	if (logger.isInfoEnabled()) logger.info("JMXtomcat is null. Creating new tomcat...");
+      	t = new JMXTomcat();
+      	t.setHttpPort(httpPort);
       }
     return t;
   }

Modified: incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/api/worker/TomcatWorkerModel.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/api/worker/TomcatWorkerModel.java?rev=422734&r1=422733&r2=422734&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/api/worker/TomcatWorkerModel.java
(original)
+++ incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/api/worker/TomcatWorkerModel.java
Mon Jul 17 07:50:51 2006
@@ -212,7 +212,9 @@
     String options;
     if (!u.isAllowed(f, p)) throw new AuthorizationException("User " + u.getName() + " Not
allowed to " + f.getName());
     if (origOptions == null || "".equals(origOptions)) {
-      options = tw.getTomcat().getServerName();
+      //options = tw.getTomcat().getServerName();
+      options = Integer.toString(tw.getTomcat().getHttpPort()) + PropertiesFile.getConstantValue("agent.delim.options")
+ tw.getTomcat().getServerName(); 
+      
     } else {
       options = tw.getTomcat().getServerName() + PropertiesFile.getConstantValue("agent.delim.options")
+ origOptions;
     }



Mime
View raw message