From scm-return-22503-apmail-geronimo-scm-archive=geronimo.apache.org@geronimo.apache.org Wed Oct 03 20:22:32 2007
Return-Path:
Delivered-To: apmail-geronimo-scm-archive@www.apache.org
Received: (qmail 70134 invoked from network); 3 Oct 2007 20:22:30 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2)
by minotaur.apache.org with SMTP; 3 Oct 2007 20:22:30 -0000
Received: (qmail 85754 invoked by uid 500); 3 Oct 2007 20:22:19 -0000
Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org
Received: (qmail 85717 invoked by uid 500); 3 Oct 2007 20:22:19 -0000
Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm
Precedence: bulk
list-help:
list-unsubscribe:
List-Post:
Reply-To: dev@geronimo.apache.org
List-Id:
Delivered-To: mailing list scm@geronimo.apache.org
Received: (qmail 85706 invoked by uid 99); 3 Oct 2007 20:22:19 -0000
Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136)
by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2007 13:22:19 -0700
X-ASF-Spam-Status: No, hits=-100.0 required=10.0
tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3)
by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2007 20:22:28 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
id 733AE1A983A; Wed, 3 Oct 2007 13:21:37 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r581714 [2/2] - in /geronimo/sandbox/monitoring: client/
client/client-ear/ client/client-ear/src/ client/client-ear/src/main/
client/client-ear/src/main/resources/
client/client-ear/src/main/resources/META-INF/ client/client-war/
client/cl...
Date: Wed, 03 Oct 2007 20:21:29 -0000
To: scm@geronimo.apache.org
From: akulshreshtha@apache.org
X-Mailer: svnmailer-1.0.8
Message-Id: <20071003202137.733AE1A983A@eris.apache.org>
X-Virus-Checked: Checked by ClamAV on apache.org
Added: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java Wed Oct 3 13:21:26 2007
@@ -0,0 +1,171 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.geronimo.plugins.monitoring.client;
+
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.Vector;
+import java.util.Set;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
+import org.apache.geronimo.plugins.monitoring.client.GraphsBuilder;
+import org.apache.geronimo.plugins.monitoring.client.util.DBManager;
+/**
+ * STATS
+ */
+public class MonitoringPortlet extends GenericPortlet {
+
+ private static final String MBEAN_JSP = "/WEB-INF/view/monitoringMbean.jsp";
+
+ private static final String TIMEFRAME_JSP = "/WEB-INF/view/monitoringTimeframe.jsp";
+
+ private static final String MAXIMIZEDVIEW_JSP = "/WEB-INF/view/monitoringMaximized.jsp";
+
+ private static final String HELPVIEW_JSP = "/WEB-INF/view/monitoringHelp.jsp";
+
+ private PortletRequestDispatcher mBeanView;
+
+ private PortletRequestDispatcher timeFrameView;
+
+ private PortletRequestDispatcher maximizedView;
+
+ private PortletRequestDispatcher helpView;
+
+ public void processAction(ActionRequest actionRequest,
+ ActionResponse actionResponse) throws PortletException, IOException {
+ actionResponse.setRenderParameter("time", actionRequest.getParameter("time"));
+ actionResponse.setRenderParameter("mode", actionRequest.getParameter("mode"));
+ if (actionRequest.getParameter("mode").equals("mbean")) {
+ actionResponse.setRenderParameter("bean", actionRequest.getParameter("bean"));
+ }
+ }
+
+ public void doView(RenderRequest request, RenderResponse response)
+ throws PortletException, IOException {
+ Integer timeFrame = 60;
+ String mode = "mbean";
+ String bean = "TomcatWebConnector";
+ if (request.getParameter("time") != null)
+ timeFrame = Integer.parseInt(request.getParameter("time"));
+ if (request.getParameter("mode") != null)
+ mode = request.getParameter("mode");
+ if (request.getParameter("bean") != null)
+ bean = request.getParameter("bean");
+ response.setProperty("time", timeFrame.toString());
+ response.setProperty("mode", mode);
+
+ try {
+
+ /* //DBBBBB_--------
+ Connection con = DBManager.getConnection();
+
+ PreparedStatement pStmt = con.prepareStatement("CREATE TABLE mrc_servers(server_id INTEGER PRIMARY KEY, server_ip VARCHAR(15), username VARCHAR(128), password VARCHAR(1024) )");
+ pStmt.executeUpdate();
+ pStmt = con.prepareStatement("INSERT INTO mrc_servers VALUES(0, '127.0.0.1', 'system', 'manager')");
+ pStmt.executeUpdate();
+ pStmt = con.prepareStatement("INSERT INTO mrc_servers VALUES(1, '127.0.0.2', 'system', 'manager')");
+ pStmt.executeUpdate();
+ pStmt = con.prepareStatement("SELECT * FROM mrc_servers");
+ ResultSet rs = pStmt.executeQuery();
+
+ while(rs.next()){
+
+ Integer server_id = rs.getInt("server_id");
+ String server_ip = rs.getString("server_ip");
+ String username = rs.getString("username");
+ String password = rs.getString("password");
+
+ System.out.println(server_id);
+ System.out.println(server_ip);
+ System.out.println(username);
+ System.out.println(password);
+ }
+ //DBBBBB_--------*/
+ GraphsBuilder run = new GraphsBuilder(0);
+ if (mode.equals("mbean")) {
+ Vector GraphVector = run.BuildOnMbean(14, timeFrame, bean);
+ Set trackedBeans = run.GetTrackedBeansPretty();
+ request.setAttribute("GraphVector", GraphVector);
+ request.setAttribute("trackedBeans", trackedBeans);
+ if (WindowState.MINIMIZED.equals(request.getWindowState())) {
+ return;
+ } else
+ mBeanView.include(request, response);
+ }
+ if (mode.equals("timeframe")) {
+ Vector GraphVector = run.BuildAllOnTimeFrame(14, timeFrame);
+ Set trackedBeans = run.GetTrackedBeansPretty();
+ request.setAttribute("GraphVector", GraphVector);
+ request.setAttribute("trackedBeans", trackedBeans);
+ if (WindowState.MINIMIZED.equals(request.getWindowState())) {
+ return;
+ } else
+ timeFrameView.include(request, response);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ //if (WindowState.MINIMIZED.equals(request.getWindowState())) {
+ //return;
+ //}
+
+ //if (WindowState.NORMAL.equals(request.getWindowState())) {
+ // normalView.include(request, response);
+ //} else {
+ // maximizedView.include(request, response);
+ //}
+
+ }
+
+ protected void doHelp(RenderRequest renderRequest,
+ RenderResponse renderResponse) throws PortletException, IOException {
+ helpView.include(renderRequest, renderResponse);
+ }
+
+ public void init(PortletConfig portletConfig) throws PortletException {
+ super.init(portletConfig);
+ mBeanView = portletConfig.getPortletContext().getRequestDispatcher(
+ MBEAN_JSP);
+ timeFrameView = portletConfig.getPortletContext().getRequestDispatcher(
+ TIMEFRAME_JSP);
+ maximizedView = portletConfig.getPortletContext().getRequestDispatcher(
+ MAXIMIZEDVIEW_JSP);
+ helpView = portletConfig.getPortletContext().getRequestDispatcher(
+ HELPVIEW_JSP);
+ }
+
+ public void destroy() {
+ mBeanView = null;
+ timeFrameView = null;
+ maximizedView = null;
+ helpView = null;
+ super.destroy();
+ }
+}
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MonitoringPortlet.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/StatsGraph.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/StatsGraph.java?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/StatsGraph.java (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/StatsGraph.java Wed Oct 3 13:21:26 2007
@@ -0,0 +1,480 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.geronimo.plugins.monitoring.client;
+
+import java.text.Format;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Vector;
+import java.lang.Character;
+
+public class StatsGraph {
+ private String GraphName;
+ private String DivName;
+ private String PrettyName;
+ private String DivDefine;
+ private String DivImplement;
+ private String XAxisLabel;
+ private String YAxisLabel;
+ private int SnapshotDuration;
+ private int TimeFrame;
+ private int PointCount;
+ private String HexColor;
+ private String GraphJS;
+
+ public StatsGraph(String graphName, String prettyName, String xAxisLabel, String yAxisLabel, Vector
+
+
The stats page needs help documentation
+
+
To return to the main Welcome panel select the "view" link from the header of this portlet.
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringHelp.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringHelp.jsp
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringHelp.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMaximized.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMaximized.jsp?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMaximized.jsp (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMaximized.jsp Wed Oct 3 13:21:26 2007
@@ -0,0 +1,17 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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.
+--%>
+<%@ include file="monitoringMbean.jsp" %>
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMaximized.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMaximized.jsp
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMaximized.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMbean.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMbean.jsp?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMbean.jsp (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMbean.jsp Wed Oct 3 13:21:26 2007
@@ -0,0 +1,86 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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.
+--%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<%@ page import="org.apache.geronimo.plugins.monitoring.client.StatsGraph" %>
+<%@ page import="java.util.Vector" %>
+<%@ page import="java.util.Set" %>
+<%@ page import="org.apache.geronimo.console.util.PortletManager" %>
+
+
+<%
+Vector GraphVector = (Vector) request.getAttribute("GraphVector");
+Set trackedBeans = (Set) request.getAttribute("trackedBeans");
+Integer time = (Integer) request.getAttribute("time");
+%>
+
+
+
+
+
+
+
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMbean.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMbean.jsp
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringMbean.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringTimeframe.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringTimeframe.jsp?rev=581714&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringTimeframe.jsp (added)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/webapp/WEB-INF/view/monitoringTimeframe.jsp Wed Oct 3 13:21:26 2007
@@ -0,0 +1,73 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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.
+--%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<%@ page import="org.apache.geronimo.plugins.monitoring.client.StatsGraph" %>
+<%@ page import="java.util.Vector" %>
+<%@ page import="org.apache.geronimo.console.util.PortletManager" %>
+
+
+<%
+Vector GraphVector = (Vector) request.getAttribute("GraphVector");
+Integer time = (Integer) request.getAttribute("time");
+%>
+
+
+
+
+
+