[clusterfest commit] r242 - in trunk: conf lib src/com/flaptor/clusterfest websrc/web-clusterfest

0 views
Skip to first unread message

codesite...@google.com

unread,
Aug 7, 2008, 1:51:24 PM8/7/08
to clust...@googlegroups.com
Author: martinmassera
Date: Wed Aug 6 12:41:47 2008
New Revision: 242

Added:
trunk/websrc/web-clusterfest/info.vm
Modified:
trunk/conf/clustering.properties.defaults
trunk/lib/flaptor-util-trunk.jar
trunk/src/com/flaptor/clusterfest/ClusterManager.java
trunk/src/com/flaptor/clusterfest/ClusterfestServlet.java
trunk/src/com/flaptor/clusterfest/NodeDescriptor.java
trunk/websrc/web-clusterfest/include.top.vm

Log:
clusterfest info page

Modified: trunk/conf/clustering.properties.defaults
==============================================================================
--- trunk/conf/clustering.properties.defaults (original)
+++ trunk/conf/clustering.properties.defaults Wed Aug 6 12:41:47 2008
@@ -1,5 +1,8 @@
clustering.nodes=
-clustering.modules=
+clustering.modules=\
+ monitor:com.flaptor.clusterfest.monitoring.MonitorModule,\
+ controller:com.flaptor.clusterfest.controlling.ControllerModule,\
+ deploy:com.flaptor.clusterfest.deploy.DeployModule

clustering.checkNodesInterval.seconds=600

clustering.monitor.formatter=com.flaptor.clusterfest.monitoring.DefaultPropertyFormatter

Modified: trunk/lib/flaptor-util-trunk.jar
==============================================================================
Binary files. No diff available.

Modified: trunk/src/com/flaptor/clusterfest/ClusterManager.java
==============================================================================
--- trunk/src/com/flaptor/clusterfest/ClusterManager.java (original)
+++ trunk/src/com/flaptor/clusterfest/ClusterManager.java Wed Aug 6
12:41:47 2008
@@ -281,4 +281,8 @@
}
return null;
}
+
+ public Map<String, Module> getModules() {
+ return modules;
+ }
}

Modified: trunk/src/com/flaptor/clusterfest/ClusterfestServlet.java
==============================================================================
--- trunk/src/com/flaptor/clusterfest/ClusterfestServlet.java (original)
+++ trunk/src/com/flaptor/clusterfest/ClusterfestServlet.java Wed Aug 6
12:41:47 2008
@@ -64,6 +64,8 @@
String template = null;
if (uri.contains("/index.do")) {
template = doStartPage(request, response);
+ } else if (uri.contains("/info.do")) {
+ template = doInfoPage(request, response);
} else if (uri.contains("/showLoginForm.do")) {
template = "login.vm";
} else if (uri.contains("/login.do")) {
@@ -97,7 +99,9 @@
return "/login.vm";
}
}
-
+ private String doInfoPage(HttpServletRequest request,
HttpServletResponse response) {
+ return "info.vm";
+ }
private String doStartPage(HttpServletRequest request,
HttpServletResponse response) {
String action = request.getParameter("action");
String message = "";

Modified: trunk/src/com/flaptor/clusterfest/NodeDescriptor.java
==============================================================================
--- trunk/src/com/flaptor/clusterfest/NodeDescriptor.java (original)
+++ trunk/src/com/flaptor/clusterfest/NodeDescriptor.java Wed Aug 6
12:41:47 2008
@@ -113,7 +113,10 @@
* @throws NodeException
*/
public void checkAndThrow(Throwable t, Logger logger) throws
NodeException {
- if (logger != null) logger.error(t, t);
+ if (logger != null) {
+ if (t instanceof RpcConnectionException)
logger.error("connection exception with node " + this + " - "+ t);
+ else logger.error("exception - node " + this, t);
+ }

if (t instanceof RpcConnectionException) throw new
NodeUnreachableException(this, t);
else if (t instanceof RemoteHostCodeException) throw new
NodeCodeException(this, t);

Modified: trunk/websrc/web-clusterfest/include.top.vm
==============================================================================
--- trunk/websrc/web-clusterfest/include.top.vm (original)
+++ trunk/websrc/web-clusterfest/include.top.vm Wed Aug 6 12:41:47 2008
@@ -33,6 +33,7 @@
#if ($monitorNode)
<a href="monitorNode.do?idx=$idx">node status</a>
#end
+ <a href="info.do">clusterfest info</a>
#if ($user)
<a href="logout.do">logout</a>
#end

Added: trunk/websrc/web-clusterfest/info.vm
==============================================================================
--- (empty file)
+++ trunk/websrc/web-clusterfest/info.vm Wed Aug 6 12:41:47 2008
@@ -0,0 +1,71 @@
+#*
+Copyright 2008 Flaptor (flaptor.com)
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*#
+## author Martin Massera
+
+#set($pageTitle = "Clusterfest Info")
+#parse("include.top.vm")
+
+#if ($message)
+ <p>$message</p>
+#end
+
+ <h2>Modules</h2>
+
+ <table>
+ <tr>
+ <th>name</th>
+ <th>class</th>
+ </tr>
+ #foreach ($e in $cluster.getModules().entrySet())
+ <tr>
+ <td><strong>$e.getKey()</strong></td>
+ <td>$e.getValue().getClass().getName()</td>
+ </tr>
+ #end
+ </table>
+
+ <h2>Web Modules</h2>
+ <table>
+ <tr>
+ <th>name</th>
+ <th>web pages</th>
+ <th>web actions</th>
+ <th>web selection actions</th>
+ </tr>
+ #foreach ($e in $cluster.getModules().entrySet())
+ <tr>
+ <td><strong>$e.getKey()</strong></td>
+ #if ($cluster.getWebModules().contains($e.getValue()))
+ <td>
+ #foreach ($item in $e.getValue().getPages())
+ $item -
+ #end
+ </td>
+ <td>
+ #foreach ($item in $e.getValue().getActions())
+ $item -
+ #end
+ </td>
+ <td>
+ #foreach ($item in
$e.getValue().getSelectedNodesActions())
+ $item.first() -
+ #end
+ </td>
+ #end
+ </tr>
+ #end
+ </table>
+#parse("include.bottom.vm")

Reply all
Reply to author
Forward
0 new messages