You are viewing a plain text version of this content. The canonical link for it is here.
Posted to lokahi-commits@incubator.apache.org by to...@apache.org on 2006/07/11 18:02:12 UTC
svn commit: r420939 - in
/incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi: core/agent/dao/
core/agent/runnable/ core/agent/task/ tomcat/gui/www/
Author: toback
Date: Tue Jul 11 11:02:12 2006
New Revision: 420939
URL: http://svn.apache.org/viewvc?rev=420939&view=rev
Log:
Added a missing counter increment in the ReportingThread
Added some more debug statements to the agent
Corrected an issue with the actions pulling the wrong parameter for tomcat workers.
Modified:
incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/dao/AgentJob.java
incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/runnable/JobScheduler.java
incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/runnable/ReportingThread.java
incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/task/UpdateTomcatTask.java
incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/gui/www/TomcatWorkerAction.java
Modified: incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/dao/AgentJob.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/dao/AgentJob.java?rev=420939&r1=420938&r2=420939&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/dao/AgentJob.java (original)
+++ incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/dao/AgentJob.java Tue Jul 11 11:02:12 2006
@@ -211,8 +211,10 @@
public boolean canRunNow() {
boolean ret =
(parentName == null || "".equals(parentName));
+ logger.debug("If false we have parentName:" + ret + " parent Name:" + parentName);
if (!ret ) {
State s = ReportingThread.getParentInfo(parentName);
+ logger.debug("Parent State:" + s);
if (s != null) {
if (s.getPk() == State.COMPLETE.getPk()) {
ret = true;
@@ -228,6 +230,7 @@
}
}
}
+ logger.debug("Returning: " + ret);
return ret;
}
Modified: incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/runnable/JobScheduler.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/runnable/JobScheduler.java?rev=420939&r1=420938&r2=420939&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/runnable/JobScheduler.java (original)
+++ incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/runnable/JobScheduler.java Tue Jul 11 11:02:12 2006
@@ -50,6 +50,7 @@
Collection<AgentJob> jobs = AgentJob.getJobs(State.NEW);
logger.debug(jobs.size() + " Jobs to perform.");
for (AgentJob j : jobs) {
+ if (logger.isDebugEnabled()) logger.debug("Checking job to see if it can run=" + j);
if (j.canRunNow()) {
if (logger.isDebugEnabled()) logger.debug("Running Job=" + j);
AgentTask task = TaskFactory.getTask(j);
@@ -57,8 +58,13 @@
if (logger.isDebugEnabled()) logger.debug("task.getClass()=" + task.getClass());
Runnable r = task.getRunnable();
if (logger.isDebugEnabled()) logger.debug("r.getClass()=" + r.getClass());
- if (r != null)
+ if (r != null){
+ try {
r.run();
+ } catch (Exception e) {
+ if (logger.isInfoEnabled()) logger.info("Exception:" + e.getMessage());
+ }
+ }
if (logger.isDebugEnabled()) logger.debug("task.isDone()=" + task.isDone());
if (task.isDone()) {
try {
@@ -80,6 +86,7 @@
logger.info("Exception: " + e.getMessage());
}
}
+ logger.debug("Finished updating Job: " + j);
}
}
}
Modified: incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/runnable/ReportingThread.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/runnable/ReportingThread.java?rev=420939&r1=420938&r2=420939&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/runnable/ReportingThread.java (original)
+++ incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/runnable/ReportingThread.java Tue Jul 11 11:02:12 2006
@@ -122,7 +122,7 @@
loc = 0;
}
queue[loc] = new FinishedJobQueueEntry(name, state);
- loc++;
+ ++loc;
}
State getState(String name) {
@@ -132,6 +132,7 @@
if (queue[loc].getJobnames() != null && name != null && name.equalsIgnoreCase(queue[loc].getJobnames())) {
s = queue[loc].getState();
}
+ ++loc;
}
return s;
}
Modified: incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/task/UpdateTomcatTask.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/task/UpdateTomcatTask.java?rev=420939&r1=420938&r2=420939&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/task/UpdateTomcatTask.java (original)
+++ incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/agent/task/UpdateTomcatTask.java Tue Jul 11 11:02:12 2006
@@ -39,9 +39,9 @@
}
public String getResult() throws TMCTaskException, ExecutionException, InterruptedException {
- String ret = "Jvn info updated";
+ String ret = "JVM info failed to update.";
if (task.get())
- ret = "JVM info failed to update.";
+ ret = "Jvm info updated";
return ret;
}
Modified: incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/gui/www/TomcatWorkerAction.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/gui/www/TomcatWorkerAction.java?rev=420939&r1=420938&r2=420939&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/gui/www/TomcatWorkerAction.java (original)
+++ incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/gui/www/TomcatWorkerAction.java Tue Jul 11 11:02:12 2006
@@ -107,7 +107,7 @@
private Collection<TomcatWorker> getMultiTemplate(DynaValidatorForm dynaForm) throws SQLException {
Collection<TomcatWorker> c = new TMCSet<TomcatWorker>();
- String[] ids = (String[]) dynaForm.get("workerId");
+ String[] ids = (String[]) dynaForm.get("id");
if (ids != null && ids.length > 0) {
StringBuffer names = new StringBuffer();
for (int i = 0; i < ids.length; i++) {