axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r390425 [1/2] - in /webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management: ./ src/org/apache/axis2/management/console/web/ src/org/apache/axis2/management/console/web/stubs/ src/org/apache/axis2/management/core/admi...
Date Fri, 31 Mar 2006 14:20:06 GMT
Author: dims
Date: Fri Mar 31 06:20:02 2006
New Revision: 390425

URL: http://svn.apache.org/viewcvs?rev=390425&view=rev
Log:
patch from Chathura Ekanayake <cce.axis@gmail.com>

Modified:
    webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/maven.xml
    webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/console/web/Axis2DynamicStatsConsole.java
    webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/console/web/Error.java
    webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/console/web/stubs/AxisServiceStatsStub.java
    webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/admin/DMAdmin.java
    webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/managers/DynamicStatsManager.java
    webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/managers/ModuleManager.java
    webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/utils/ServiceStats.java
    webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AbstractDMService.java
    webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AxisModules.java
    webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AxisOperationStats.java
    webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AxisServiceStats.java
    webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/xdocs/management.html

Modified: webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/maven.xml?rev=390425&r1=390424&r2=390425&view=diff
==============================================================================
--- webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/maven.xml (original)
+++ webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/maven.xml Fri Mar 31 06:20:02 2006
@@ -1,43 +1,44 @@
-<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util">
-  <goal name="all" prereqs="java:compile">
-
-	<jar jarfile="target/management.jar" basedir="target/classes">
-		<include name="org/apache/axis2/management/core/**/*" /> 
-	</jar>
-
-
-	<mkdir dir="target/classes/META-INF" />
-	<copy file="resources/management-services/services.xml" tofile="target/classes/META-INF/services.xml" />
-	<jar jarfile="target/management.aar" basedir="target/classes">
-		<include name="org/apache/axis2/management/interfaces/ws/**/*" /> 
-		<include name="META-INF/services.xml" />
-	</jar>
-
-	<copy file="resources/management-module/module.xml" tofile="target/classes/META-INF/module.xml" />
-	<jar jarfile="target/management.mar" basedir="target/classes">
-		<include name="org/apache/axis2/management/invoker/**/*" /> 
-		<include name="META-INF/module.xml" />
-	</jar>
-
-	<mkdir dir="target/temp-war/WEB-INF/lib" />
-	<mkdir dir="target/temp-war/images" />
-	<mkdir dir="target/temp-war/css" />
-	<copy file="resources/management-console/web.xml" tofile="target/temp-war/WEB-INF/web.xml" />
-	<copy todir="target/temp-war/images">
-		<fileset dir="resources/management-console/images" />
-	</copy>
-	<copy todir="target/temp-war/css">
-		<fileset dir="resources/management-console/css" />
-	</copy>
-	<jar jarfile="target/temp-war/WEB-INF/lib/axis2console.jar" basedir="target/classes">
-		<include name="org/apache/axis2/management/console/web/**/*" /> 
-	</jar>
-	<jar jarfile="target/axis2console.war" basedir="target/temp-war">
-		<include name="**/*" /> 
-	</jar>
-	<delete includeEmptyDirs="true">
-		<fileset dir="target/temp-war" />
-	</delete>
-
- </goal>
-</project>
+<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util">
+  <goal name="all" prereqs="java:compile">
+
+	<jar jarfile="target/management.jar" basedir="target/classes">
+		<include name="org/apache/axis2/management/core/**/*" /> 
+		<include name="org/apache/axis2/management/interfaces/jmx/**/*" />
+	</jar>
+
+
+	<mkdir dir="target/classes/META-INF" />
+	<copy file="resources/management-services/services.xml" tofile="target/classes/META-INF/services.xml" />
+	<jar jarfile="target/management.aar" basedir="target/classes"> 
+		<include name="org/apache/axis2/management/interfaces/ws/**/*" /> 
+		<include name="META-INF/services.xml" />
+	</jar>
+
+	<copy file="resources/management-module/module.xml" tofile="target/classes/META-INF/module.xml" />
+	<jar jarfile="target/management.mar" basedir="target/classes">
+		<include name="org/apache/axis2/management/invoker/**/*" />  
+		<include name="META-INF/module.xml" />
+	</jar>
+
+	<mkdir dir="target/temp-war/WEB-INF/lib" />
+	<mkdir dir="target/temp-war/images" />
+	<mkdir dir="target/temp-war/css" />
+	<copy file="resources/management-console/web.xml" tofile="target/temp-war/WEB-INF/web.xml" />
+	<copy todir="target/temp-war/images">
+		<fileset dir="resources/management-console/images" />
+	</copy>
+	<copy todir="target/temp-war/css">
+		<fileset dir="resources/management-console/css" />
+	</copy>
+	<jar jarfile="target/temp-war/WEB-INF/lib/axis2console.jar" basedir="target/classes">
+		<include name="org/apache/axis2/management/console/web/**/*" /> 
+	</jar>
+	<jar jarfile="target/axis2console.war" basedir="target/temp-war">
+		<include name="**/*" /> 
+	</jar>
+	<delete includeEmptyDirs="true">
+		<fileset dir="target/temp-war" />
+	</delete>
+
+ </goal>
+</project>

Modified: webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/console/web/Axis2DynamicStatsConsole.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/console/web/Axis2DynamicStatsConsole.java?rev=390425&r1=390424&r2=390425&view=diff
==============================================================================
--- webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/console/web/Axis2DynamicStatsConsole.java (original)
+++ webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/console/web/Axis2DynamicStatsConsole.java Fri Mar 31 06:20:02 2006
@@ -1,209 +1,211 @@
-package org.apache.axis2.management.console.web;
-
-import org.apache.axis2.management.console.web.stubs.AxisDynamicStatsStub;
-import org.apache.axis2.management.console.web.stubs.AxisServiceStatsStub;
-import org.apache.axis2.management.console.web.stubs.AxisOperationStatsStub;
-import org.apache.axis2.management.console.web.stubs.AxisGlobalsStub;
-import org.apache.axis2.management.console.web.stubs.AxisServicesStub;
-
-import java.io.PrintWriter;
-import java.io.IOException;
-import java.util.StringTokenizer;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-public class Axis2DynamicStatsConsole extends HttpServlet{
-
-	PrintWriter writer = null;
-
-	AxisDynamicStatsStub axisDynamicStatsStub = null;
-	AxisServiceStatsStub axisServiceStatsStub = null;
-	AxisOperationStatsStub axisOperationStatsStub = null;
-	AxisGlobalsStub axisGlobalsStub = null;
-	AxisServicesStub axisServicesStub = null;
-
-	public void init(ServletConfig config) throws ServletException{
-
-	}
-
-	public void doGet(HttpServletRequest request, HttpServletResponse response)
-		throws ServletException, IOException{
-
-			writer = response.getWriter();
-
-			response.setContentType("text/html");
-			response.setHeader("Cache-Control", "no-store");
-
-			PrintWriter out = response.getWriter();
-
-			String docType = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " + "Transitional//EN\">\n";
-
-			out.println(docType +
-						"<html>\n" +
-						"<head><title>Axis2Console</title><link href=\"css/axis-style.css\" rel=\"stylesheet\" type=\"text/css\"/></head>\n" +
-						"<body>");
-
-
-
-			process(request, response);
-
-			out.println("</body></html>");
-
-	}
-
-
-	public void process(HttpServletRequest request, HttpServletResponse response){
-
-		echo("<table width=\"100%\" height=\"100%\"><tr><td><table width=\"100%\"><tr><td aligns=\"left\"><img src= \"images/asf-logo.gif\" /></td><td align=\"right\"><img src = \"images/axis.jpg\" /></td></table></tr><tr><td align=\"center\"><h1>Management Console</h1></tr>");
-
-		try {
-
-			HttpSession session = request.getSession(false);
-			String host = session.getAttribute("host").toString();
-			axisDynamicStatsStub = new AxisDynamicStatsStub(host);
-			axisServiceStatsStub = new AxisServiceStatsStub(host);
-			axisOperationStatsStub = new AxisOperationStatsStub(host);
-			axisGlobalsStub = new AxisGlobalsStub(host);
-			axisServicesStub = new AxisServicesStub(host);
-			
-			if(request.getParameter("level") != null) {
-				monitorService(request);
-				monitorOperation(request);
-			}
-
-			echo("<tr><td bgcolor=\"#000080\"><font color=\"#FFFFFF\"><a href=\"axis2console\">Axis2 Globals</a> | " +
-					"<a href=\"modules\">Modules</a> | " +
-					"<a href=\"transports\">Transports</a> | " +
-					"<a href=\"service_groups\">ServiceGroups</a> | " +
-					"<a href=\"services\">Services</a> | " +
-					"<a href=\"operations\">Operations</a> | " +
-					"<a href=\"dynamicstats\">Statistics</a> | " +
-					"<a href=\"login\">Log out</a></td></tr>" +
-					"<tr><td colspan=\"2\"></font></td></tr>");
-
-			echo("<tr><td width=\"100%\" align=\"left\" valign=\"top\">");
-			displayServiceMonitorPanel();
-			displayOperationMonitorPanel(request.getParameter("service"));
-			echo("</td></tr>");
-			echo("<tr><td height=\"100%\" width=\"100%\" align=\"left\" valign=\"top\">");
-			displayDynamicStats();
-			echo("</td></tr></table>");
-
-		} catch(Exception e) {
-			try {
-				response.sendRedirect("error");
-			} catch(Exception error) {
-				echo("<tr><td><hr />Exception occured.\n" + error.getMessage() + "</td></tr>");
-			}
-		}
-
-	}
-	
-	private void displayMonitorPanel() throws Exception {
-		
-	}
-	
-	private void displayServiceMonitorPanel() {
-		
-		echo("<h2>Monitor service</h2>");
-		
-		echo("<form action=\"dynamicstats\" method=\"get\">" +
-				"<input type=\"hidden\" name=\"level\" value=\"service\" />" +
-				"<select name=\"service\">");
-		String[] services = axisGlobalsStub.getServices();
-		for(int i=0; i<services.length; i++) {
-			echo("<option align=\"left\" value=\""+services[i]+"\">"+services[i]+"</option>");
-		}
-		echo("</select>" +
-		"<input type=\"submit\" value=\"Monitor\" /></form>");
-	}
-	
-	private void displayOperationMonitorPanel(String serviceName) {
-		
-		echo("<h2>Monitor operation</h2>");
-		
-		echo("<form action=\"dynamicstats\" method=\"get\" name=\"operationMonitorForm\">" +
-				"<input type=\"hidden\" name=\"level\" value=\"operation\" />" +
-				"<input type=\"hidden\" name=\"serviceChanged\"/>" +
-				"<select name=\"service\" onChange=\"document.operationMonitorForm.serviceChanged.value=true;document.operationMonitorForm.submit()\">");
-		String[] services = axisGlobalsStub.getServices();
-		for(int i=0; i<services.length; i++) {
-			String selected = "";
-			if(services[i].equals(serviceName)) {
-				selected = "selected=\"true\"";
-			}
-			echo("<option "+selected+"align=\"left\" value=\""+services[i]+"\">"+services[i]+"</option>");
-		}
-		echo("</select>" +
-				"<select name=\"operation\">");
-		
-		if(serviceName == null) {
-			String[] deployedServices = axisGlobalsStub.getServices();
-			if(deployedServices.length == 0)
-				echo("<option>-No services are deployed-</option>");
-			else
-				serviceName = deployedServices[0];
-		} 
-		
-		String[] operations = axisServicesStub.getOperations(serviceName);
-		for(int i=0; i<operations.length; i++) {
-			echo("<option align=\"left\" value=\""+operations[i]+"\">"+operations[i]+"</option>");
-		}
-		
-		echo("</select>" +
-				"<input type=\"submit\" value=\"Monitor\" /></form>");
-	}
-
-	private void displayDynamicStats() throws Exception {
-		// display dynamic statistics
-		echo("<h3>Axis2 Dynamic Statistics</h3>");
-		echo("<table width=\"100%\">" +
-				"<tr><td></td><td></td><td align=\"center\">In messages</td><td align=\"center\">Out messages</td><td align=\"center\">Fault in messages</td><td align=\"center\">Fault out messages</td></tr>");
-		String[] data = axisDynamicStatsStub.getMonitoredData();
-		for(int i=0; i<data.length; i++) {
-			StringTokenizer tokens = new StringTokenizer(data[i], ":");
-			String ID = tokens.nextToken();
-			if(ID.equals("All")) {
-				echo("<tr bgcolor=\"#99CCFF\"><td>"+ID+"</td><td>"+tokens.nextToken()+"</td><td align=\"right\">"+tokens.nextToken()+"</td><td align=\"right\">"+tokens.nextToken()+"</td><td align=\"right\"><font color=\"#FF0000\">"+tokens.nextToken()+"</font></td><td align=\"right\"><font color=\"#FF0000\">"+tokens.nextToken()+"</font></td></tr>");
-			} else if(ID.equals("Service")) {
-				echo("<tr bgcolor=\"#CCCCFF\"><td>"+ID+"</td><td>"+tokens.nextToken()+"</td><td align=\"right\">"+tokens.nextToken()+"</td><td align=\"right\">"+tokens.nextToken()+"</td><td align=\"right\"><font color=\"#FF0000\">"+tokens.nextToken()+"</font></td><td align=\"right\"><font color=\"#FF0000\">"+tokens.nextToken()+"</font></td></tr>");
-			} else if(ID.equals("Operation")) {
-				echo("<tr bgcolor=\"#CCFFFF\"><td>"+ID+"</td><td>"+tokens.nextToken()+"</td><td align=\"right\">"+tokens.nextToken()+"</td><td align=\"right\">"+tokens.nextToken()+"</td><td align=\"right\"><font color=\"#FF0000\">"+tokens.nextToken()+"</font></td><td align=\"right\"><font color=\"#FF0000\">"+tokens.nextToken()+"</font></td></tr>");
-			}
-		}
-		echo("</table>");
-	}
-	
-	private void monitorService(HttpServletRequest request) {
-		
-		if(request.getParameter("level").equals("service")) {
-			String service = request.getParameter("service");
-			
-			if(service != null) {
-				axisServiceStatsStub.setServiceToMonitor(service);
-			}
-		}
-	}
-	
-	private void monitorOperation(HttpServletRequest request) {
-		
-		if(request.getParameter("level").equals("operation")) {
-			String service = request.getParameter("service");
-			String operation = request.getParameter("operation");
-			
-			if(service != null && operation != null && !request.getParameter("serviceChanged").equals("true")) {
-				axisOperationStatsStub.setOperationToMonitor(service, operation);
-			}
-		}
-	}
-	
-	private void echo(String info){
-		writer.println("<p>" + info + "</p>");
-	}
-}
-	
+package org.apache.axis2.management.console.web;
+
+import org.apache.axis2.management.console.web.stubs.AxisDynamicStatsStub;
+import org.apache.axis2.management.console.web.stubs.AxisServiceStatsStub;
+import org.apache.axis2.management.console.web.stubs.AxisOperationStatsStub;
+import org.apache.axis2.management.console.web.stubs.AxisGlobalsStub;
+import org.apache.axis2.management.console.web.stubs.AxisServicesStub;
+
+import java.io.PrintWriter;
+import java.io.IOException;
+import java.util.StringTokenizer;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class Axis2DynamicStatsConsole extends HttpServlet{
+
+	PrintWriter writer = null;
+
+	AxisDynamicStatsStub axisDynamicStatsStub = null;
+	AxisServiceStatsStub axisServiceStatsStub = null;
+	AxisOperationStatsStub axisOperationStatsStub = null;
+	AxisGlobalsStub axisGlobalsStub = null;
+	AxisServicesStub axisServicesStub = null;
+
+	public void init(ServletConfig config) throws ServletException{
+
+	}
+
+	public void doGet(HttpServletRequest request, HttpServletResponse response)
+		throws ServletException, IOException{
+
+			writer = response.getWriter();
+
+			response.setContentType("text/html");
+			response.setHeader("Cache-Control", "no-store");
+
+			PrintWriter out = response.getWriter();
+
+			String docType = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " + "Transitional//EN\">\n";
+
+			out.println(docType +
+						"<html>\n" +
+						"<head><title>Axis2Console</title><link href=\"css/axis-style.css\" rel=\"stylesheet\" type=\"text/css\"/></head>\n" +
+						"<body>");
+
+
+
+			process(request, response);
+
+			out.println("</body></html>");
+
+	}
+
+
+	public void process(HttpServletRequest request, HttpServletResponse response){
+
+		echo("<table width=\"100%\" height=\"100%\"><tr><td><table width=\"100%\"><tr><td aligns=\"left\"><img src= \"images/asf-logo.gif\" /></td><td align=\"right\"><img src = \"images/axis.jpg\" /></td></table></tr><tr><td align=\"center\"><h1>Management Console</h1></tr>");
+
+		try {
+
+			HttpSession session = request.getSession(false);
+			String host = session.getAttribute("host").toString();
+			axisDynamicStatsStub = new AxisDynamicStatsStub(host);
+			axisServiceStatsStub = new AxisServiceStatsStub(host);
+			axisOperationStatsStub = new AxisOperationStatsStub(host);
+			axisGlobalsStub = new AxisGlobalsStub(host);
+			axisServicesStub = new AxisServicesStub(host);
+			
+			if(request.getParameter("level") != null) {
+				monitorService(request);
+				monitorOperation(request);
+			}
+
+			echo("<tr><td bgcolor=\"#000080\"><font color=\"#FFFFFF\"><a href=\"axis2console\">Axis2 Globals</a> | " +
+					"<a href=\"modules\">Modules</a> | " +
+					"<a href=\"transports\">Transports</a> | " +
+					"<a href=\"service_groups\">ServiceGroups</a> | " +
+					"<a href=\"services\">Services</a> | " +
+					"<a href=\"operations\">Operations</a> | " +
+					"<a href=\"dynamicstats\">Statistics</a> | " +
+					"<a href=\"login\">Log out</a></td></tr>" +
+					"<tr><td colspan=\"2\"></font></td></tr>");
+
+			echo("<tr><td width=\"100%\" align=\"left\" valign=\"top\">");
+			displayServiceMonitorPanel();
+			displayOperationMonitorPanel(request.getParameter("service"));
+			echo("</td></tr>");
+			echo("<tr><td height=\"100%\" width=\"100%\" align=\"left\" valign=\"top\">");
+			displayDynamicStats();
+			echo("</td></tr></table>");
+
+		} catch(Exception e) {
+			try {
+				response.sendRedirect("error");
+			} catch(Exception error) {
+				echo("<tr><td><hr />Exception occured.\n" + error.getMessage() + "</td></tr>");
+			}
+		}
+
+	}
+	
+	private void displayMonitorPanel() throws Exception {
+		
+	}
+	
+	private void displayServiceMonitorPanel() {
+		
+		echo("<h2>Monitor service</h2>");
+		
+		echo("<form action=\"dynamicstats\" method=\"get\">" +
+				"<input type=\"hidden\" name=\"level\" value=\"service\" />" +
+				"<select name=\"service\">");
+		String[] services = axisGlobalsStub.getServices();
+		for(int i=0; i<services.length; i++) {
+			echo("<option align=\"left\" value=\""+services[i]+"\">"+services[i]+"</option>");
+		}
+		echo("</select>" +
+		"<input type=\"submit\" value=\"Monitor\" /></form>");
+	}
+	
+	private void displayOperationMonitorPanel(String serviceName) {
+		
+		echo("<h2>Monitor operation</h2>");
+		
+		echo("<form action=\"dynamicstats\" method=\"get\" name=\"operationMonitorForm\">" +
+				"<input type=\"hidden\" name=\"level\" value=\"operation\" />" +
+				"<input type=\"hidden\" name=\"serviceChanged\"/>" +
+				"<select name=\"service\" onChange=\"document.operationMonitorForm.serviceChanged.value=true;document.operationMonitorForm.submit()\">");
+		String[] services = axisGlobalsStub.getServices();
+		for(int i=0; i<services.length; i++) {
+			String selected = "";
+			if(services[i].equals(serviceName)) {
+				selected = "selected=\"true\"";
+			}
+			echo("<option "+selected+"align=\"left\" value=\""+services[i]+"\">"+services[i]+"</option>");
+		}
+		echo("</select>" +
+				"<select name=\"operation\">");
+		
+		if(serviceName == null) {
+			String[] deployedServices = axisGlobalsStub.getServices();
+			if(deployedServices.length == 0)
+				echo("<option>-No services are deployed-</option>");
+			else
+				serviceName = deployedServices[0];
+		} 
+		
+		String[] operations = axisServicesStub.getOperations(serviceName);
+		for(int i=0; i<operations.length; i++) {
+			echo("<option align=\"left\" value=\""+operations[i]+"\">"+operations[i]+"</option>");
+		}
+		
+		echo("</select>" +
+				"<input type=\"submit\" value=\"Monitor\" /></form>");
+	}
+
+	private void displayDynamicStats() throws Exception {
+		// display dynamic statistics
+		echo("<h3>Axis2 Dynamic Statistics</h3>");
+		echo("<table width=\"100%\">" +
+				"<tr><td></td><td></td><td align=\"center\">In messages</td><td align=\"center\">Out messages</td><td align=\"center\">Fault in messages</td><td align=\"center\">Fault out messages</td></tr>");
+		String[] data = axisDynamicStatsStub.getMonitoredData();
+		for(int i=0; i<data.length; i++) {
+			StringTokenizer tokens = new StringTokenizer(data[i], ":");
+			String ID = tokens.nextToken();
+			if(ID.equals("All")) {
+				echo("<tr bgcolor=\"#99CCFF\"><td>"+ID+"</td><td>"+tokens.nextToken()+"</td><td align=\"right\">"+tokens.nextToken()+"</td><td align=\"right\">"+tokens.nextToken()+"</td><td align=\"right\"><font color=\"#FF0000\">"+tokens.nextToken()+"</font></td><td align=\"right\"><font color=\"#FF0000\">"+tokens.nextToken()+"</font></td></tr>");
+			} else if(ID.equals("Service")) {
+				echo("<tr bgcolor=\"#CCCCFF\"><td>"+ID+"</td><td>"+tokens.nextToken()+"</td><td align=\"right\">"+tokens.nextToken()+"</td><td align=\"right\">"+tokens.nextToken()+"</td><td align=\"right\"><font color=\"#FF0000\">"+tokens.nextToken()+"</font></td><td align=\"right\"><font color=\"#FF0000\">"+tokens.nextToken()+"</font></td></tr>");
+			} else if(ID.equals("Operation")) {
+				echo("<tr bgcolor=\"#CCFFFF\"><td>"+ID+"</td><td>"+tokens.nextToken()+"</td><td align=\"right\">"+tokens.nextToken()+"</td><td align=\"right\">"+tokens.nextToken()+"</td><td align=\"right\"><font color=\"#FF0000\">"+tokens.nextToken()+"</font></td><td align=\"right\"><font color=\"#FF0000\">"+tokens.nextToken()+"</font></td></tr>");
+			}
+		}
+		echo("</table>");
+	}
+	
+	private void monitorService(HttpServletRequest request) {
+		
+		System.out.println("INFO: monitor service invoked.");
+		if(request.getParameter("level").equals("service")) {
+			String service = request.getParameter("service");
+			
+			System.out.println("INFO: Service monitor setting..");
+			if(service != null) {
+				axisServiceStatsStub.setServiceToMonitor(service);
+			}
+		}
+	}
+	
+	private void monitorOperation(HttpServletRequest request) {
+		
+		if(request.getParameter("level").equals("operation")) {
+			String service = request.getParameter("service");
+			String operation = request.getParameter("operation");
+			
+			if(service != null && operation != null && !request.getParameter("serviceChanged").equals("true")) {
+				axisOperationStatsStub.setOperationToMonitor(service, operation);
+			}
+		}
+	}
+	
+	private void echo(String info){
+		writer.println("<p>" + info + "</p>");
+	}
+}
+	
 	

Modified: webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/console/web/Error.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/console/web/Error.java?rev=390425&r1=390424&r2=390425&view=diff
==============================================================================
--- webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/console/web/Error.java (original)
+++ webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/console/web/Error.java Fri Mar 31 06:20:02 2006
@@ -1,63 +1,63 @@
-package org.apache.axis2.management.console.web;
-
-import java.io.PrintWriter;
-import java.io.IOException;
-import java.util.StringTokenizer;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-public class Error extends HttpServlet{
-
-	PrintWriter writer = null;
-
-	public void init(ServletConfig config) throws ServletException{
-
-	}
-
-	public void doGet(HttpServletRequest request, HttpServletResponse response)
-		throws ServletException, IOException{
-
-			writer = response.getWriter();
-
-			response.setContentType("text/html");
-			response.setHeader("Cache-Control", "no-store");
-
-			String docType = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " + "Transitional//EN\">\n";
-
-			writer.println(docType +
-						"<html>\n" +
-						"<head><title>Axis2Console</title><link href=\"css/axis-style.css\" rel=\"stylesheet\" type=\"text/css\"/></head>\n" +
-						"<body>");
-
-
-
-			process(request, response);
-
-			writer.println("</body></html>");
-	}
-
-	private void echo(String info){
-		writer.println("<p>" + info + "</p>");
-	}
-
-	private void process(HttpServletRequest request, HttpServletResponse response) {
-
-		echo("<table width=\"100%\"><tr><td><table width=\"100%\"><tr><td align=\"left\"><img src= \"images/asf-logo.gif\" /></td><td align=\"right\"><img src = \"images/axis.jpg\" /></td></table></tr><tr><td align=\"center\"><h1>Management Console</h1></tr>");
-		echo("<tr><td><h1>Error</h1>" +
-				"<p>An error was occured while performing the operation. Please check if you have performed following steps." +
-				"<ul>" +
-					"<li>management.mar module is deployed in the \"modules\" directory.</li><br /><br />" +
-					"<li>dmservices.aar is deployed in the \"services\" directory.</li><br /><br />" +
-					"<li>dm.jar is deployed in the \"lib\" directory.</li><br /><br />" +
-					"<li>Axis2 jars are accessible from the Axis2Console servlet. Axis2Console uses Axis2 jars as a web services client. Therefore those jars should be placed in \"shared\\lib\" directory or \"webapps\\axis2web\\WEB-INF\\lib\" directory if you are using Tomcat. Consult the documentation for other servlet containers.</li><br /><br />" +
-					"<li>The host address is supplied correctly in the Login screen. Host address is the URL of Axis2 directory in the format \"http://&ltip-address&gt:&ltport&gt/axis2\". For example if you are running Tomcat on port 8080 in localhost, the host address is \"http://localhost:8080/axis2\".</li><br /><br />" +
-				"</ul>" +
-				"<br />" +
-				"Send a mail to Axis2 mailing list if you still get errors." +
-				"</p>");
-	}
+package org.apache.axis2.management.console.web;
+
+import java.io.PrintWriter;
+import java.io.IOException;
+import java.util.StringTokenizer;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class Error extends HttpServlet{
+
+	PrintWriter writer = null;
+
+	public void init(ServletConfig config) throws ServletException{
+
+	}
+
+	public void doGet(HttpServletRequest request, HttpServletResponse response)
+		throws ServletException, IOException{
+
+			writer = response.getWriter();
+
+			response.setContentType("text/html");
+			response.setHeader("Cache-Control", "no-store");
+
+			String docType = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " + "Transitional//EN\">\n";
+
+			writer.println(docType +
+						"<html>\n" +
+						"<head><title>Axis2Console</title><link href=\"css/axis-style.css\" rel=\"stylesheet\" type=\"text/css\"/></head>\n" +
+						"<body>");
+
+
+
+			process(request, response);
+
+			writer.println("</body></html>");
+	}
+
+	private void echo(String info){
+		writer.println("<p>" + info + "</p>");
+	}
+
+	private void process(HttpServletRequest request, HttpServletResponse response) {
+
+		echo("<table width=\"100%\"><tr><td><table width=\"100%\"><tr><td align=\"left\"><img src= \"images/asf-logo.gif\" /></td><td align=\"right\"><img src = \"images/axis.jpg\" /></td></table></tr><tr><td align=\"center\"><h1>Management Console</h1></tr>");
+		echo("<tr><td><h1>Error</h1>" +
+				"<p>An error was occured while performing the operation. Please check if you have performed following steps." +
+				"<ul>" +
+					"<li>management.mar module is deployed in the \"axis2\\WEB-INF\\modules\" directory.</li><br /><br />" +
+					"<li>management.aar is deployed in the \"axis2\\WEB-INF\\services\" directory.</li><br /><br />" +
+					"<li>management.jar is deployed in the \"axis2\\WEB-INF\\lib\" directory.</li><br /><br />" +
+					"<li>Axis2 jars are accessible from the Axis2Console servlet. Axis2Console uses Axis2 jars as a web services client. Therefore those jars should be placed in \"shared\\lib\" directory or \"webapps\\axis2console\\WEB-INF\\lib\" directory if you are using Tomcat. Consult the documentation for other servlet containers.</li><br /><br />" +
+					"<li>The host address is supplied correctly in the Login screen. Host address is the URL of Axis2 directory in the format \"http://&ltip-address&gt:&ltport&gt/axis2\". For example if you are running Tomcat on port 8080 in localhost, the host address is \"http://localhost:8080/axis2\".</li><br /><br />" +
+				"</ul>" +
+				"<br />" +
+				"Send a mail to Axis2 mailing list if you still get errors." +
+				"</p>");
+	}
 }

Modified: webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/console/web/stubs/AxisServiceStatsStub.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/console/web/stubs/AxisServiceStatsStub.java?rev=390425&r1=390424&r2=390425&view=diff
==============================================================================
--- webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/console/web/stubs/AxisServiceStatsStub.java (original)
+++ webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/console/web/stubs/AxisServiceStatsStub.java Fri Mar 31 06:20:02 2006
@@ -1,40 +1,41 @@
-package org.apache.axis2.management.console.web.stubs;
-
-import org.apache.axis2.Constants;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.ws.commons.om.OMElement;
-import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.client.Options;
-
-public class AxisServiceStatsStub extends AbstractStub {
-
-	private EndpointReference targetEPR = null;
-
-
-	public AxisServiceStatsStub(String host) {
-		targetEPR = new EndpointReference(host+"/services/AxisServiceStats");
-	}
-	
-	
-	public void setServiceToMonitor(String serviceName) {
-		
-		OMElement method = getMethod("setServiceToMonitor", new String[]{serviceName});
-		invoke(targetEPR, method);
-	}
-
-	
-	public String getInMessages() {
-		
-		OMElement method = getMethod("getInMessages", new String[]{});
-		OMElement result = invoke(targetEPR, method);
-			
-		return unpackValue(result);
-	}	
-	
-	
-	public void clearInMessages() {
-		
-		OMElement method = getMethod("clearInMessages", new String[]{});
-		invoke(targetEPR, method);
-	}
+package org.apache.axis2.management.console.web.stubs;
+
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.ws.commons.om.OMElement;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.client.Options;
+
+public class AxisServiceStatsStub extends AbstractStub {
+
+	private EndpointReference targetEPR = null;
+
+
+	public AxisServiceStatsStub(String host) {
+		targetEPR = new EndpointReference(host+"/services/AxisServiceStats");
+	}
+	
+	
+	public void setServiceToMonitor(String serviceName) {
+		
+		System.out.println("INFO: stub setServiceToMonitor invoked.");
+		OMElement method = getMethod("setServiceToMonitor", new String[]{serviceName});
+		invoke(targetEPR, method);
+	}
+
+	
+	public String getInMessages() {
+		
+		OMElement method = getMethod("getInMessages", new String[]{});
+		OMElement result = invoke(targetEPR, method);
+			
+		return unpackValue(result);
+	}	
+	
+	
+	public void clearInMessages() {
+		
+		OMElement method = getMethod("clearInMessages", new String[]{});
+		invoke(targetEPR, method);
+	}
 }

Modified: webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/admin/DMAdmin.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/admin/DMAdmin.java?rev=390425&r1=390424&r2=390425&view=diff
==============================================================================
--- webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/admin/DMAdmin.java (original)
+++ webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/admin/DMAdmin.java Fri Mar 31 06:20:02 2006
@@ -1,45 +1,96 @@
-package org.apache.axis2.management.core.admin;
-
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.AxisFault;
-
-import org.apache.axis2.management.core.managers.GlobalManager;
-import org.apache.axis2.management.core.managers.ModuleManager;
-import org.apache.axis2.management.core.managers.TransportManager;
-import org.apache.axis2.management.core.managers.ServiceGroupManager;
-import org.apache.axis2.management.core.managers.ServiceManager;
-import org.apache.axis2.management.core.managers.OperationManager;
-import org.apache.axis2.management.core.managers.DynamicStatsManager;
-
-public class DMAdmin {
-
-	public void initManagement(ConfigurationContext configContext) {
-
-		System.out.println("Initiating management objects...");
-		
-		GlobalManager globalManager = new GlobalManager(configContext);
-		configContext.setProperty("global_manager", globalManager);
-		
-		ModuleManager moduleManager = new ModuleManager(configContext);
-		configContext.setProperty("module_manager", moduleManager);
-		
-		TransportManager transportManager = new TransportManager(configContext);
-		configContext.setProperty("transport_manager", transportManager);
-		
-		ServiceGroupManager serviceGroupManager = new ServiceGroupManager(configContext);
-		configContext.setProperty("servicegroup_manager", serviceGroupManager);
-		
-		ServiceManager serviceManager = new ServiceManager(configContext);
-		configContext.setProperty("service_manager", serviceManager);
-		
-		OperationManager operationManager = new OperationManager(configContext);
-		configContext.setProperty("operation_manager", operationManager);
-
-		DynamicStatsManager dynamicStatsManager = new DynamicStatsManager(configContext);
-		configContext.setProperty("dynamic_stats", dynamicStatsManager);
-		
-		System.out.println("Initiating management objects completed.");
-
-	}
-
+package org.apache.axis2.management.core.admin;
+
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.AxisFault;
+
+import org.apache.axis2.management.core.utils.JMXUtil;
+import org.apache.axis2.management.core.managers.GlobalManager;
+import org.apache.axis2.management.core.managers.ModuleManager;
+import org.apache.axis2.management.core.managers.TransportManager;
+import org.apache.axis2.management.core.managers.ServiceGroupManager;
+import org.apache.axis2.management.core.managers.ServiceManager;
+import org.apache.axis2.management.core.managers.OperationManager;
+import org.apache.axis2.management.core.managers.DynamicStatsManager;
+
+import org.apache.axis2.management.interfaces.jmx.*;
+
+public class DMAdmin {
+
+	public void initManagement(ConfigurationContext configContext) {
+
+		System.out.println("Initiating management objects...");
+		
+		GlobalManager globalManager = new GlobalManager(configContext);
+		configContext.setProperty("global_manager", globalManager);
+		
+		ModuleManager moduleManager = new ModuleManager(configContext);
+		configContext.setProperty("module_manager", moduleManager);
+		
+		TransportManager transportManager = new TransportManager(configContext);
+		configContext.setProperty("transport_manager", transportManager);
+		
+		ServiceGroupManager serviceGroupManager = new ServiceGroupManager(configContext);
+		configContext.setProperty("servicegroup_manager", serviceGroupManager);
+		
+		ServiceManager serviceManager = new ServiceManager(configContext);
+		configContext.setProperty("service_manager", serviceManager);
+		
+		OperationManager operationManager = new OperationManager(configContext);
+		configContext.setProperty("operation_manager", operationManager);
+
+		DynamicStatsManager dynamicStatsManager = new DynamicStatsManager(configContext);
+		configContext.setProperty("dynamic_stats", dynamicStatsManager);
+		
+		System.out.println("Initiating management objects completed.");
+		
+		try {
+			initJMX(configContext);
+		} catch(Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	
+	public void initJMX(ConfigurationContext configContext) throws Exception {
+		
+		System.out.println("Initializing JMX interface...");
+		
+		JMXUtil jmxUtil = new JMXUtil();
+		
+		AxisGlobalsMBean axisGlobalsMBean = new AxisGlobalsMBean();
+		axisGlobalsMBean.init(configContext);
+		jmxUtil.registerMBean(axisGlobalsMBean, "Axis2:name=org.apache.axis2.management.AxisGlobalsMBean", "AxisGlobals");
+		
+		AxisModulesMBean axisModulesMBean = new AxisModulesMBean();
+		axisModulesMBean.init(configContext);
+		jmxUtil.registerMBean(axisModulesMBean, "Axis2:name=org.apache.axis2.management.AxisModulesMBean", "AxisModules");
+		
+		AxisTransportsMBean axisTransportsMBean = new AxisTransportsMBean();
+		axisTransportsMBean.init(configContext);
+		jmxUtil.registerMBean(axisTransportsMBean, "Axis2:name=org.apache.axis2.management.AxisTransportsMBean", "AxisTransports");
+		
+		AxisServiceGroupsMBean axisServiceGroupsMBean = new AxisServiceGroupsMBean();
+		axisServiceGroupsMBean.init(configContext);
+		jmxUtil.registerMBean(axisServiceGroupsMBean, "Axis2:name=org.apache.axis2.management.AxisServiceGroupsMBean", "AxisServiceGroups");
+		
+		AxisServicesMBean axisServicesMBean = new AxisServicesMBean();
+		axisServicesMBean.init(configContext);
+		jmxUtil.registerMBean(axisServicesMBean, "Axis2:name=org.apache.axis2.management.AxisServicesMBean", "AxisServices");
+		
+		AxisOperationsMBean axisOperationsMBean = new AxisOperationsMBean();
+		axisOperationsMBean.init(configContext);
+		jmxUtil.registerMBean(axisOperationsMBean, "Axis2:name=org.apache.axis2.management.AxisOperationsMBean", "AxisOperations");
+		
+		DynamicStatsManagerMBean dynamicStatsManagerMBean = new DynamicStatsManagerMBean();
+		dynamicStatsManagerMBean.init(configContext);
+		jmxUtil.registerMBean(dynamicStatsManagerMBean, "Axis2:name=org.apache.axis2.management.AxisGlbalStatsMBean", "AxisGlobalStats");
+		
+		AxisServiceStatsMBean axisServiceStatsMBean = new AxisServiceStatsMBean();
+		axisServiceStatsMBean.init(configContext);
+		jmxUtil.registerMBean(axisServiceStatsMBean, "Axis2:name=org.apache.axis2.management.AxisServiceStatsMBean", "AxisServiceStats");
+		
+		AxisOperationStatsMBean axisOperationStatsMBean = new AxisOperationStatsMBean();
+		axisOperationStatsMBean.init(configContext);
+		jmxUtil.registerMBean(axisOperationStatsMBean, "Axis2:name=org.apache.axis2.management.AxisOperationStatsMBean", "AxisOperationStats");	
+	}
 }

Modified: webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/managers/DynamicStatsManager.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/managers/DynamicStatsManager.java?rev=390425&r1=390424&r2=390425&view=diff
==============================================================================
--- webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/managers/DynamicStatsManager.java (original)
+++ webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/managers/DynamicStatsManager.java Fri Mar 31 06:20:02 2006
@@ -1,162 +1,167 @@
-package org.apache.axis2.management.core.managers;
-
-import org.apache.axis2.management.core.utils.ServiceStats;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.description.AxisModule;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.AxisServiceGroup;
-import org.apache.axis2.description.TransportInDescription;
-import org.apache.axis2.description.TransportOutDescription;
-import org.apache.axis2.description.Parameter;
-
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Collection;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-
-public class DynamicStatsManager {
-
-
-	private ConfigurationContext configContext = null;
-	private AxisConfiguration axisConfig = null;
-
-	private HashMap serviceStatsMap = null;
-	private int inMessages = 0;
-	private int outMessages = 0;
-	private int inFaultMessages = 0;
-	private int outFaultMessages = 0;
-
-
-	public DynamicStatsManager(ConfigurationContext configContext) {
-		this.configContext = configContext;
-		this.axisConfig = configContext.getAxisConfiguration();
-
-		serviceStatsMap = new HashMap();
-
-		System.out.println("DynamicStatsManager instantaited.");
-	}
-
-
-	public void updateStats(MessageContext msgContext) {
-		
-		System.out.println("NOTIFYING S1");
-		
-		if(msgContext != null) {
-		
-			// monitor global requests
-			if(msgContext.getFLOW() == MessageContext.IN_FLOW) {
-				System.out.println("IN MESSAGE");
-				inMessages++;
-				
-				if(msgContext.isProcessingFault()) {
-					inFaultMessages++;
-					System.out.println("FAULT");
-				}
-			} else if(msgContext.getFLOW() == MessageContext.OUT_FLOW) {
-				System.out.println("OUT MESSAGE");
-				outMessages++;
-				
-				if(msgContext.isProcessingFault()) {
-					outFaultMessages++;
-					System.out.println("FAULT");
-				}
-			} 
-	
-			// monitor service level requests
-			String serviceName = msgContext.getAxisService().getName();
-			System.out.println("NOTIFYING S3");
-			ServiceStats serviceStats = (ServiceStats)serviceStatsMap.get(serviceName);
-			System.out.println("NOTIFYING S4");
-			if(serviceStats != null) {
-				serviceStats.updateStats(msgContext);
-			}
-		}
-	}
-
-
-	public int getInMessages() {
-		return inMessages;
-	}
-	
-
-	public void clearInMessages() {
-		inMessages = 0;
-	}
-	
-	
-	public int getOutMessages() {
-		return outMessages;
-	}
-	
-
-	public void clearOutMessages() {
-		outMessages = 0;
-	}
-	
-	
-	public int getFaultInMessages() {
-		return inFaultMessages;
-	}
-	
-
-	public void clearFaultInMessages() {
-		inFaultMessages = 0;
-	}
-	
-	
-	public int getFaultOutMessages() {
-		return outFaultMessages;
-	}
-	
-
-	public void clearFaultOutMessages() {
-		outFaultMessages = 0;
-	}
-	
-	
-	public HashMap getMonitoredServices() {
-		return serviceStatsMap;
-	}
-
-
-	public void setServiceToMonitor(String serviceName) {
-		
-		ServiceStats serviceStats = new ServiceStats();
-
-		if(!serviceStatsMap.containsKey(serviceName)) {
-			serviceStatsMap.put(serviceName, serviceStats);
-		}	
-	}
-
-	
-	public ServiceStats getMonitoredService(String serviceName) throws AxisFault {
-		
-		ServiceStats serviceStats = (ServiceStats)serviceStatsMap.get(serviceName);
-
-		if(serviceStats == null) {
-			throw new AxisFault("Service not monitored.");
-		} 
-
-		return serviceStats;
-	}
-	
-	
-	public boolean isServiceMonitoring(String serviceName) {
-		ServiceStats serviceStats = (ServiceStats)serviceStatsMap.get(serviceName);
-
-		if(serviceStats == null) {
-			return false;
-		} 
-
-		return true;
-	}
+package org.apache.axis2.management.core.managers;
+
+import org.apache.axis2.management.core.utils.ServiceStats;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.description.AxisModule;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.AxisServiceGroup;
+import org.apache.axis2.description.TransportInDescription;
+import org.apache.axis2.description.TransportOutDescription;
+import org.apache.axis2.description.Parameter;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+
+public class DynamicStatsManager {
+
+
+	private ConfigurationContext configContext = null;
+	private AxisConfiguration axisConfig = null;
+
+	private HashMap serviceStatsMap = null;
+	private int inMessages = 0;
+	private int outMessages = 0;
+	private int inFaultMessages = 0;
+	private int outFaultMessages = 0;
+
+
+	public DynamicStatsManager(ConfigurationContext configContext) {
+		this.configContext = configContext;
+		this.axisConfig = configContext.getAxisConfiguration();
+
+		serviceStatsMap = new HashMap();
+
+		System.out.println("DynamicStatsManager instantaited.");
+	}
+
+
+	public void updateStats(MessageContext msgContext) {
+		
+		System.out.println("NOTIFYING S1");
+		
+		if(msgContext != null) {
+		
+			// monitor global requests
+			if(msgContext.getFLOW() == MessageContext.IN_FLOW) {
+				System.out.println("IN MESSAGE");
+				inMessages++;
+				
+				if(msgContext.isProcessingFault()) {
+					inFaultMessages++;
+					System.out.println("FAULT");
+				}
+			} else if(msgContext.getFLOW() == MessageContext.OUT_FLOW) {
+				System.out.println("OUT MESSAGE");
+				outMessages++;
+				
+				if(msgContext.isProcessingFault()) {
+					outFaultMessages++;
+					System.out.println("FAULT");
+				}
+			} 
+	
+			// monitor service level requests
+			String serviceName = msgContext.getAxisService().getName();
+			System.out.println("NOTIFYING S3");
+			ServiceStats serviceStats = (ServiceStats)serviceStatsMap.get(serviceName);
+			System.out.println("NOTIFYING S4");
+			if(serviceStats != null) {
+				serviceStats.updateStats(msgContext);
+			}
+		}
+	}
+
+
+	public int getInMessages() {
+		return inMessages;
+	}
+	
+
+	public void clearInMessages() {
+		inMessages = 0;
+	}
+	
+	
+	public int getOutMessages() {
+		return outMessages;
+	}
+	
+
+	public void clearOutMessages() {
+		outMessages = 0;
+	}
+	
+	
+	public int getFaultInMessages() {
+		return inFaultMessages;
+	}
+	
+
+	public void clearFaultInMessages() {
+		inFaultMessages = 0;
+	}
+	
+	
+	public int getFaultOutMessages() {
+		return outFaultMessages;
+	}
+	
+
+	public void clearFaultOutMessages() {
+		outFaultMessages = 0;
+	}
+	
+	
+	public HashMap getMonitoredServices() {
+		return serviceStatsMap;
+	}
+
+
+	public void setServiceToMonitor(String serviceName) {
+		
+		System.out.println("INFO: Setting service to monitor.");
+		ServiceStats serviceStats = new ServiceStats();
+
+		if(!serviceStatsMap.containsKey(serviceName)) {
+			System.out.println("INFO: Service not already monitoring.");
+			serviceStatsMap.put(serviceName, serviceStats);
+		}	
+	}
+
+	
+	public ServiceStats getMonitoredService(String serviceName) throws AxisFault {
+		
+		System.out.println("INFO: Getting monitored service.");
+		
+		ServiceStats serviceStats = (ServiceStats)serviceStatsMap.get(serviceName);
+
+		if(serviceStats == null) {
+			System.out.println("INFO: Service Not monitored.");
+			throw new AxisFault("Service not monitored.");
+		} 
+
+		return serviceStats;
+	}
+	
+	
+	public boolean isServiceMonitoring(String serviceName) {
+		ServiceStats serviceStats = (ServiceStats)serviceStatsMap.get(serviceName);
+
+		if(serviceStats == null) {
+			return false;
+		} 
+
+		return true;
+	}
 }

Modified: webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/managers/ModuleManager.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/managers/ModuleManager.java?rev=390425&r1=390424&r2=390425&view=diff
==============================================================================
--- webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/managers/ModuleManager.java (original)
+++ webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/managers/ModuleManager.java Fri Mar 31 06:20:02 2006
@@ -1,211 +1,211 @@
-package org.apache.axis2.management.core.managers;
-
-
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisModule;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.AxisFault;
-
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Collection;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-
-public class ModuleManager {
-
-
-	private ConfigurationContext configContext = null;
-	private AxisConfiguration axisConfig = null;	
-
-
-	public ModuleManager(ConfigurationContext configContext) {
-		this.configContext = configContext;
-		this.axisConfig = configContext.getAxisConfiguration();
-
-		System.out.println("BasicManager instantaited.");
-	}
-	
-	
-	public String isEngagedGlobally(String moduleName) {
-		
-		String result = "FALSE";
-		Collection engagedModuleCollection = axisConfig.getEngagedModules();
-		if(engagedModuleCollection.contains(new QName(moduleName))) {
-			result = "TRUE";
-		}
-		
-		return result;
-	}
-	
-	
-	public String[] getEngagedServices(String moduleName) {
-		
-		ArrayList engagedServicesList = new ArrayList();
-		
-		if(isEngagedGlobally(moduleName).equals("FALSE")) {
-			HashMap serviceMap = axisConfig.getServices();
-			if(serviceMap!=null && !serviceMap.isEmpty()) {
-				Collection serviceCollection = serviceMap.values();
-				
-				for(Iterator iterator=serviceCollection.iterator(); iterator.hasNext();) {
-					AxisService axisService = (AxisService)iterator.next();
-					Collection engagedModuleCollection = axisService.getEngagedModules();
-					for(Iterator serviceModuleIterator=engagedModuleCollection.iterator(); serviceModuleIterator.hasNext();){
-						AxisModule moduleDesc = (AxisModule)serviceModuleIterator.next();
-						QName axisModule = moduleDesc.getName();
-						if(axisModule.getLocalPart().equals(moduleName)) {
-							engagedServicesList.add(axisService.getName());
-						}
-					}
-				}
-			}
-		}
-		
-		String[] engagedServices = (String[])engagedServicesList.toArray(new String[engagedServicesList.size()]);
-		return engagedServices;
-	}
-	
-	
-	public String[] getEngagedOperations(String moduleName) {
-		
-		ArrayList engagedOperationsList = new ArrayList();
-		
-		HashMap serviceMap = axisConfig.getServices();
-		if(serviceMap!=null && !serviceMap.isEmpty()) {
-			Collection serviceCollection = serviceMap.values();
-			
-			for(Iterator iterator=serviceCollection.iterator(); iterator.hasNext();) {
-				AxisService axisService = (AxisService)iterator.next();
-				Collection engagedModuleCollection = axisService.getEngagedModules();
-				
-				boolean serviceLevel = false;
-				for(Iterator serviceModuleIterator=engagedModuleCollection.iterator(); serviceModuleIterator.hasNext();){
-					AxisModule moduleDesc = (AxisModule)serviceModuleIterator.next();
-					QName axisModule = moduleDesc.getName();
-					if(axisModule.getLocalPart().equals(moduleName)) {
-						serviceLevel = true;
-						break;
-					}
-				}
-				
-				if(!serviceLevel) {
-					// module is not engaged to this service.
-					// so find out if it is engaged to any operations
-					
-					Iterator operations = null;
-					
-					try {
-						operations = axisService.getOperations();
-					} catch(Exception e) {
-						e.printStackTrace();
-					}
-
-					if(operations != null) {
-
-						//Collection operationsCollection = operationsMap.values();
-
-						while(operations.hasNext()){
-							AxisOperation axisOperation = (AxisOperation)operations.next();
-							
-							Collection operationEngagedModules = axisOperation.getEngagedModules();
-							for(Iterator operationModuleIterator=operationEngagedModules.iterator(); operationModuleIterator.hasNext();){
-								AxisModule operationModuleDesc = (AxisModule)operationModuleIterator.next();
-								QName axisOperationModule = operationModuleDesc.getName();
-								if(axisOperationModule.getLocalPart().equals(moduleName)) {
-									engagedOperationsList.add(axisService.getName()+"."+axisOperation.getName().getLocalPart());
-								}
-							}
-						}
-					
-					}
-				}
-			}
-		}
-		
-		String[] engagedOperations = (String[])engagedOperationsList.toArray(new String[engagedOperationsList.size()]);
-		return engagedOperations;
-	}	
-
-
-	public String[] getModuleParameters(String moduleName) {
-
-		String[] paramters = null;
-
-		try{
-			AxisModule moduleDesc = axisConfig.getModule(new QName(moduleName));
-			ArrayList paramList = moduleDesc.getParameters();
-			paramters = new String[paramList.size()];
-
-			for (int i = 0; i < paramList.size(); i++) {
-				 Parameter parameter = (Parameter)paramList.get(i);
-				 paramters[i] = parameter.getName() + ":" + parameter.getValue();
-			 }
-
-		}catch(Exception e){
-			e.printStackTrace();
-		}
-
-		return paramters;
-	}
-
-
-	public boolean isModuleParameter(String moduleName, String paramName) {
-
-		Parameter parameter = null;
-
-		try {
-			AxisModule moduleDesc = axisConfig.getModule(new QName(moduleName));
-			parameter = moduleDesc.getParameter(paramName);
-		} catch(Exception e) {
-			e.printStackTrace();
-		}
-
-		if(parameter == null)
-			return false;
-
-		return true;
-	}
-
-
-	public void addModuleParameter(String moduleName, String name, String value) {
-
-		try {
-			Parameter param = new Parameter(name, value);
-			AxisModule moduleDesc = axisConfig.getModule(new QName(moduleName));
-			moduleDesc.addParameter(param);
-		} catch(Exception e) {
-			e.printStackTrace();
-		}
-	}
-
-
-	public String editModuleParameter(String moduleName, String parameterName, String value) {
-
-		String info = "";
-
-		try{
-
-			AxisModule moduleDesc = axisConfig.getModule(new QName(moduleName));
-			Parameter parameter = moduleDesc.getParameter(parameterName);
-			if(parameter == null)
-				throw new Exception("Parameter: " + parameterName + " not found.");
-
-			parameter.setValue(value);
-			info = "Paramter changed successfully.";
-
-		}catch(Exception e){
-			info = e.getMessage();
-		}
-
-		return info;
-	}
-
+package org.apache.axis2.management.core.managers;
+
+
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisModule;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.AxisFault;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+
+public class ModuleManager {
+
+
+	private ConfigurationContext configContext = null;
+	private AxisConfiguration axisConfig = null;	
+
+
+	public ModuleManager(ConfigurationContext configContext) {
+		this.configContext = configContext;
+		this.axisConfig = configContext.getAxisConfiguration();
+
+		System.out.println("BasicManager instantaited.");
+	}
+	
+	
+	public boolean isEngagedGlobally(String moduleName) {
+		
+		boolean result = false;
+		Collection engagedModuleCollection = axisConfig.getEngagedModules();
+		if(engagedModuleCollection.contains(new QName(moduleName))) {
+			result = true;
+		}
+		
+		return result;
+	}
+	
+	
+	public String[] getEngagedServices(String moduleName) {
+		
+		ArrayList engagedServicesList = new ArrayList();
+		
+		if(isEngagedGlobally(moduleName)) {
+			HashMap serviceMap = axisConfig.getServices();
+			if(serviceMap!=null && !serviceMap.isEmpty()) {
+				Collection serviceCollection = serviceMap.values();
+				
+				for(Iterator iterator=serviceCollection.iterator(); iterator.hasNext();) {
+					AxisService axisService = (AxisService)iterator.next();
+					Collection engagedModuleCollection = axisService.getEngagedModules();
+					for(Iterator serviceModuleIterator=engagedModuleCollection.iterator(); serviceModuleIterator.hasNext();){
+						AxisModule moduleDesc = (AxisModule)serviceModuleIterator.next();
+						QName axisModule = moduleDesc.getName();
+						if(axisModule.getLocalPart().equals(moduleName)) {
+							engagedServicesList.add(axisService.getName());
+						}
+					}
+				}
+			}
+		}
+		
+		String[] engagedServices = (String[])engagedServicesList.toArray(new String[engagedServicesList.size()]);
+		return engagedServices;
+	}
+	
+	
+	public String[] getEngagedOperations(String moduleName) {
+		
+		ArrayList engagedOperationsList = new ArrayList();
+		
+		HashMap serviceMap = axisConfig.getServices();
+		if(serviceMap!=null && !serviceMap.isEmpty()) {
+			Collection serviceCollection = serviceMap.values();
+			
+			for(Iterator iterator=serviceCollection.iterator(); iterator.hasNext();) {
+				AxisService axisService = (AxisService)iterator.next();
+				Collection engagedModuleCollection = axisService.getEngagedModules();
+				
+				boolean serviceLevel = false;
+				for(Iterator serviceModuleIterator=engagedModuleCollection.iterator(); serviceModuleIterator.hasNext();){
+					AxisModule moduleDesc = (AxisModule)serviceModuleIterator.next();
+					QName axisModule = moduleDesc.getName();
+					if(axisModule.getLocalPart().equals(moduleName)) {
+						serviceLevel = true;
+						break;
+					}
+				}
+				
+				if(!serviceLevel) {
+					// module is not engaged to this service.
+					// so find out if it is engaged to any operations
+					
+					Iterator operations = null;
+					
+					try {
+						operations = axisService.getOperations();
+					} catch(Exception e) {
+						e.printStackTrace();
+					}
+
+					if(operations != null) {
+
+						//Collection operationsCollection = operationsMap.values();
+
+						while(operations.hasNext()){
+							AxisOperation axisOperation = (AxisOperation)operations.next();
+							
+							Collection operationEngagedModules = axisOperation.getEngagedModules();
+							for(Iterator operationModuleIterator=operationEngagedModules.iterator(); operationModuleIterator.hasNext();){
+								AxisModule operationModuleDesc = (AxisModule)operationModuleIterator.next();
+								QName axisOperationModule = operationModuleDesc.getName();
+								if(axisOperationModule.getLocalPart().equals(moduleName)) {
+									engagedOperationsList.add(axisService.getName()+"."+axisOperation.getName().getLocalPart());
+								}
+							}
+						}
+					
+					}
+				}
+			}
+		}
+		
+		String[] engagedOperations = (String[])engagedOperationsList.toArray(new String[engagedOperationsList.size()]);
+		return engagedOperations;
+	}	
+
+
+	public String[] getModuleParameters(String moduleName) {
+
+		String[] paramters = null;
+
+		try{
+			AxisModule moduleDesc = axisConfig.getModule(new QName(moduleName));
+			ArrayList paramList = moduleDesc.getParameters();
+			paramters = new String[paramList.size()];
+
+			for (int i = 0; i < paramList.size(); i++) {
+				 Parameter parameter = (Parameter)paramList.get(i);
+				 paramters[i] = parameter.getName() + ":" + parameter.getValue();
+			 }
+
+		}catch(Exception e){
+			e.printStackTrace();
+		}
+
+		return paramters;
+	}
+
+
+	public boolean isModuleParameter(String moduleName, String paramName) {
+
+		Parameter parameter = null;
+
+		try {
+			AxisModule moduleDesc = axisConfig.getModule(new QName(moduleName));
+			parameter = moduleDesc.getParameter(paramName);
+		} catch(Exception e) {
+			e.printStackTrace();
+		}
+
+		if(parameter == null)
+			return false;
+
+		return true;
+	}
+
+
+	public void addModuleParameter(String moduleName, String name, String value) {
+
+		try {
+			Parameter param = new Parameter(name, value);
+			AxisModule moduleDesc = axisConfig.getModule(new QName(moduleName));
+			moduleDesc.addParameter(param);
+		} catch(Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+
+	public String editModuleParameter(String moduleName, String parameterName, String value) {
+
+		String info = "";
+
+		try{
+
+			AxisModule moduleDesc = axisConfig.getModule(new QName(moduleName));
+			Parameter parameter = moduleDesc.getParameter(parameterName);
+			if(parameter == null)
+				throw new Exception("Parameter: " + parameterName + " not found.");
+
+			parameter.setValue(value);
+			info = "Paramter changed successfully.";
+
+		}catch(Exception e){
+			info = e.getMessage();
+		}
+
+		return info;
+	}
+
 }

Modified: webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/utils/ServiceStats.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/utils/ServiceStats.java?rev=390425&r1=390424&r2=390425&view=diff
==============================================================================
--- webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/utils/ServiceStats.java (original)
+++ webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/core/utils/ServiceStats.java Fri Mar 31 06:20:02 2006
@@ -1,115 +1,117 @@
-
-package org.apache.axis2.management.core.utils;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-
-import java.util.HashMap;
-
-
-public class ServiceStats {
-
-	private HashMap operationStatsMap = null;
-	private int inMessages = 0;
-	private int outMessages = 0;
-	private int inFaultMessages = 0;
-	private int outFaultMessages = 0;
-	
-	
-	public ServiceStats() {
-		operationStatsMap = new HashMap();
-	}
-	
-	
-	public int getInMessages() {
-		return inMessages;
-	}
-	
-
-	public void clearInMessages() {
-		inMessages = 0;
-	}
-	
-	
-	public int getOutMessages() {
-		return outMessages;
-	}
-	
-
-	public void clearOutMessages() {
-		outMessages = 0;
-	}
-	
-	
-	public int getFaultInMessages() {
-		return inFaultMessages;
-	}
-	
-
-	public void clearFaultInMessages() {
-		inFaultMessages = 0;
-	}
-	
-	
-	public int getFaultOutMessages() {
-		return outFaultMessages;
-	}
-	
-
-	public void clearFaultOutMessages() {
-		outFaultMessages = 0;
-	}
-	
-	
-	public HashMap getMonitoredOperations() {
-		return operationStatsMap;
-	}
-	
-	
-	public void updateStats(MessageContext msgContext) {
-		// monitor service level requests
-		if(msgContext.getFLOW() == MessageContext.IN_FLOW) {
-			inMessages++;
-			
-			if(msgContext.isProcessingFault()) {
-				inFaultMessages++;
-			}
-		} else if(msgContext.getFLOW() == MessageContext.OUT_FLOW) {
-			outMessages++;
-			
-			if(msgContext.isProcessingFault()) {
-				outFaultMessages++;
-			}
-		}
-
-		// monitor operation level requests
-		String operationName = msgContext.getAxisOperation().getName().getLocalPart();
-		OperationStats operationStats = (OperationStats)operationStatsMap.get(operationName);
-		if(operationStats != null) {
-			operationStats.updateStats(msgContext);
-		}
-	}
-	
-	
-	public void setOperationToMonitor(String operationName) {
-
-		if(!operationStatsMap.containsKey(operationName)) {
-			OperationStats operationStats = new OperationStats();
-			operationStatsMap.put(operationName, operationStats);
-		}	
-	}
-	
-	
-	public OperationStats getMonitoredOperation(String operationName) throws AxisFault {
-
-		OperationStats operationStats = (OperationStats)operationStatsMap.get(operationName);
-		
-		if(operationStats == null) {
-			throw new AxisFault("Operation not monitored.");
-		}
-
-		return operationStats;
-	}
-
+
+package org.apache.axis2.management.core.utils;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+
+import java.util.HashMap;
+
+
+public class ServiceStats {
+
+	private HashMap operationStatsMap = null;
+	private int inMessages = 0;
+	private int outMessages = 0;
+	private int inFaultMessages = 0;
+	private int outFaultMessages = 0;
+	
+	
+	public ServiceStats() {
+		operationStatsMap = new HashMap();
+	}
+	
+	
+	public int getInMessages() {
+		System.out.println("INFO: Returning in messages.");
+		return inMessages;
+	}
+	
+
+	public void clearInMessages() { 
+		inMessages = 0;
+	}
+	
+	
+	public int getOutMessages() {
+		return outMessages;
+	}
+	
+
+	public void clearOutMessages() {
+		outMessages = 0;
+	}
+	
+	
+	public int getFaultInMessages() {
+		return inFaultMessages;
+	}
+	
+	public void clearFaultInMessages() {
+		inFaultMessages = 0;
+	}
+	
+	
+	public int getFaultOutMessages() {
+		return outFaultMessages;
+	}
+	
+
+	public void clearFaultOutMessages() {
+		outFaultMessages = 0;
+	}
+	
+	
+	public HashMap getMonitoredOperations() {
+		return operationStatsMap;
+	}
+	
+	
+	public void updateStats(MessageContext msgContext) {
+		
+		System.out.println("INFO: Updating service stats.");
+		// monitor service level requests
+		if(msgContext.getFLOW() == MessageContext.IN_FLOW) {
+			inMessages++;
+			
+			if(msgContext.isProcessingFault()) {
+				inFaultMessages++;
+			}
+		} else if(msgContext.getFLOW() == MessageContext.OUT_FLOW) {
+			outMessages++;
+			
+			if(msgContext.isProcessingFault()) {
+				outFaultMessages++;
+			}
+		}
+
+		// monitor operation level requests
+		String operationName = msgContext.getAxisOperation().getName().getLocalPart();
+		OperationStats operationStats = (OperationStats)operationStatsMap.get(operationName);
+		if(operationStats != null) {
+			operationStats.updateStats(msgContext);
+		}
+	}
+	
+	
+	public void setOperationToMonitor(String operationName) {
+
+		if(!operationStatsMap.containsKey(operationName)) {
+			OperationStats operationStats = new OperationStats();
+			operationStatsMap.put(operationName, operationStats);
+		}	
+	}
+	
+	
+	public OperationStats getMonitoredOperation(String operationName) throws AxisFault {
+
+		OperationStats operationStats = (OperationStats)operationStatsMap.get(operationName);
+		
+		if(operationStats == null) {
+			throw new AxisFault("Operation not monitored.");
+		}
+
+		return operationStats;
+	}
+
 }

Modified: webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AbstractDMService.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AbstractDMService.java?rev=390425&r1=390424&r2=390425&view=diff
==============================================================================
--- webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AbstractDMService.java (original)
+++ webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AbstractDMService.java Fri Mar 31 06:20:02 2006
@@ -1,126 +1,87 @@
-package org.apache.axis2.management.interfaces.ws;
-
-import org.apache.axis2.management.core.managers.GlobalManager;
-import org.apache.axis2.management.core.managers.ModuleManager;
-import org.apache.axis2.management.core.managers.TransportManager;
-import org.apache.axis2.management.core.managers.ServiceGroupManager;
-import org.apache.axis2.management.core.managers.ServiceManager;
-import org.apache.axis2.management.core.managers.OperationManager;
-import org.apache.axis2.management.core.managers.DynamicStatsManager;
-
-
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.ConfigurationContext;
-
-import org.apache.ws.commons.om.OMAbstractFactory;
-import org.apache.ws.commons.om.OMElement;
-import org.apache.ws.commons.om.OMFactory;
-import org.apache.ws.commons.om.OMNamespace;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import javax.xml.stream.XMLStreamException;
-
-public class AbstractDMService {
-	
-	
-	private MessageContext msgContext = null;
-	private ConfigurationContext configContext = null;
-
-	
-	public void init(MessageContext context) {
-		msgContext = context;
-		configContext = context.getConfigurationContext();
-	}
-	
-	
-	public GlobalManager getGlobalManager() {
-		return (GlobalManager)configContext.getProperty("global_manager");
-	}
-	
-	
-	public ModuleManager getModuleManager() {
-		return (ModuleManager)configContext.getProperty("module_manager");
-	}
-	
-	
-	public TransportManager getTransportManager() {
-		return (TransportManager)configContext.getProperty("transport_manager");
-	}
-	
-	
-	public ServiceGroupManager getServiceGroupManager() {
-		return (ServiceGroupManager)configContext.getProperty("servicegroup_manager");
-	}
-	
-	
-	public ServiceManager getServiceManager() {
-		return (ServiceManager)configContext.getProperty("service_manager");
-	}
-	
-	
-	public OperationManager getOperationManager() {
-		return (OperationManager)configContext.getProperty("operation_manager");
-	}
-	
-	
-	public DynamicStatsManager getDynamicStatsManager() {
-		return (DynamicStatsManager)configContext.getProperty("dynamic_stats");
-	}
-
-
-	public String[] getParameters(OMElement element) {
-
-		element.build();
-		element.detach();
-
-		ArrayList parameterList = new ArrayList();
-		Iterator iterator = element.getChildren();
-		
-		while(iterator.hasNext()) {
-			OMElement value = (OMElement)iterator.next();
-			parameterList.add(value.getText());
-		}
-
-		String[] parameters = (String[])parameterList.toArray(new String[parameterList.size()]);
-		return parameters;
-	}
-
-
-	public OMElement packValues(String[] values) {
-
-		OMElement element = null;
-		if(values != null) {
-			OMFactory fac = OMAbstractFactory.getOMFactory();
-			OMNamespace omNs = fac.createOMNamespace("http://org.apache.axis2.management.axisservices", "axisservices");
-			element = fac.createOMElement("AxisServices", omNs);
-	
-			for(int i=0; i< values.length; i++) {
-				OMElement value = fac.createOMElement("value", omNs);
-				value.addChild(fac.createText(value, values[i]));
-	
-				element.addChild(value);
-			}
-		} else {
-			element = packValues(new String[]{});
-		}
-
-		return element;
-	}
-
-
-	public OMElement packValue(String value) {
-
-		OMFactory fac = OMAbstractFactory.getOMFactory();
-		OMNamespace omNs = fac.createOMNamespace("http://org.apache.axis2.management.axisservices", "axisservices");
-		OMElement element = fac.createOMElement("AxisServices", omNs);
-
-		OMElement valueElement = fac.createOMElement("value", omNs);
-		valueElement.addChild(fac.createText(valueElement, value));
-		element.addChild(valueElement);
-
-		return element;
-	}
-
+package org.apache.axis2.management.interfaces.ws;
+
+//import org.apache.axis2.management.interfaces.AbstractManagemetInterface;
+import org.apache.axis2.management.core.managers.GlobalManager;
+import org.apache.axis2.management.core.managers.ModuleManager;
+import org.apache.axis2.management.core.managers.TransportManager;
+import org.apache.axis2.management.core.managers.ServiceGroupManager;
+import org.apache.axis2.management.core.managers.ServiceManager;
+import org.apache.axis2.management.core.managers.OperationManager;
+import org.apache.axis2.management.core.managers.DynamicStatsManager;
+
+
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.ConfigurationContext;
+
+import org.apache.ws.commons.om.OMAbstractFactory;
+import org.apache.ws.commons.om.OMElement;
+import org.apache.ws.commons.om.OMFactory;
+import org.apache.ws.commons.om.OMNamespace;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.xml.stream.XMLStreamException;
+
+public class AbstractDMService extends AbstractManagementInterface {
+	
+	
+	public void init(MessageContext context) {
+		super.init(context.getConfigurationContext());
+	}
+	
+
+	public String[] getParameters(OMElement element) {
+
+		element.build();
+		element.detach();
+
+		ArrayList parameterList = new ArrayList();
+		Iterator iterator = element.getChildren();
+		
+		while(iterator.hasNext()) {
+			OMElement value = (OMElement)iterator.next();
+			parameterList.add(value.getText());
+		}
+
+		String[] parameters = (String[])parameterList.toArray(new String[parameterList.size()]);
+		return parameters;
+	}
+
+
+	public OMElement packValues(String[] values) {
+
+		OMElement element = null;
+		if(values != null) {
+			OMFactory fac = OMAbstractFactory.getOMFactory();
+			OMNamespace omNs = fac.createOMNamespace("http://org.apache.axis2.management.axisservices", "axisservices");
+			element = fac.createOMElement("AxisServices", omNs);
+	
+			for(int i=0; i< values.length; i++) {
+				OMElement value = fac.createOMElement("value", omNs);
+				value.addChild(fac.createText(value, values[i]));
+	
+				element.addChild(value);
+			}
+		} else {
+			element = packValues(new String[]{});
+		}
+
+		return element;
+	}
+
+
+	public OMElement packValue(String value) {
+
+		OMFactory fac = OMAbstractFactory.getOMFactory();
+		OMNamespace omNs = fac.createOMNamespace("http://org.apache.axis2.management.axisservices", "axisservices");
+		OMElement element = fac.createOMElement("AxisServices", omNs);
+
+		OMElement valueElement = fac.createOMElement("value", omNs);
+		valueElement.addChild(fac.createText(valueElement, value));
+		element.addChild(valueElement);
+
+		return element;
+	}
+
 }

Modified: webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AxisModules.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AxisModules.java?rev=390425&r1=390424&r2=390425&view=diff
==============================================================================
--- webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AxisModules.java (original)
+++ webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AxisModules.java Fri Mar 31 06:20:02 2006
@@ -1,102 +1,108 @@
-package org.apache.axis2.management.interfaces.ws;
-
-import org.apache.axis2.management.core.managers.ModuleManager;
-
-import org.apache.ws.commons.om.OMAbstractFactory;
-import org.apache.ws.commons.om.OMElement;
-import org.apache.ws.commons.om.OMFactory;
-import org.apache.ws.commons.om.OMNamespace;
-
-import javax.xml.stream.XMLStreamException;
-
-public class AxisModules extends AbstractDMService {
-
-
-	public OMElement getInfo() throws XMLStreamException {
-		return packValue("This is the AxisModules module management web module.");
-	}
-
-	
-	public OMElement getModuleParameters(OMElement element) throws XMLStreamException {
-
-		String[] params = getParameters(element);
-		
-		ModuleManager moduleManager = getModuleManager();
-		String[] moduleParameters = moduleManager.getModuleParameters(params[0]);
-
-		return packValues(moduleParameters);
-	}
-
-
-	public OMElement isModuleParameter(OMElement element) {
-
-		String[] params = getParameters(element);
-
-		ModuleManager moduleManager = getModuleManager();
-		boolean available = moduleManager.isModuleParameter(params[0], params[1]);
-
-		OMElement result;
-		if(available)
-			result = packValue("TRUE");
-		else
-			result = packValue("FALSE");
-
-		return result;
-	}
-
-
-	public OMElement addModuleParameter(OMElement element) throws XMLStreamException {
-
-		String[] params = getParameters(element);
-		
-		ModuleManager moduleManager = getModuleManager();
-		moduleManager.addModuleParameter(params[0], params[1], params[2]);
-
-		return packValue("OUT NOT AVAILABLE");
-	}
-
-
-	public OMElement editModuleParameter(OMElement element) throws XMLStreamException {
-
-		String[] params = getParameters(element);
-		
-		ModuleManager moduleManager = getModuleManager();
-		String result = moduleManager.editModuleParameter(params[0], params[1], params[2]);
-
-		return packValue(result);
-	}
-	
-	
-	public OMElement isEngagedGlobally(OMElement element) throws XMLStreamException {
-
-		String[] params = getParameters(element);
-		
-		ModuleManager moduleManager = getModuleManager();
-		String result = moduleManager.isEngagedGlobally(params[0]);
-
-		return packValue(result);
-	}
-	
-	
-	public OMElement getEngagedServices(OMElement element) throws XMLStreamException {
-
-		String[] params = getParameters(element);
-		
-		ModuleManager moduleManager = getModuleManager();
-		String[] engagedServices = moduleManager.getEngagedServices(params[0]);
-
-		return packValues(engagedServices);
-	}
-	
-	
-	public OMElement getEngagedOperations(OMElement element) throws XMLStreamException {
-
-		String[] params = getParameters(element);
-		
-		ModuleManager moduleManager = getModuleManager();
-		String[] engagedOperations = moduleManager.getEngagedOperations(params[0]);
-
-		return packValues(engagedOperations);
-	}
-
-}
+package org.apache.axis2.management.interfaces.ws;
+
+import org.apache.axis2.management.core.managers.ModuleManager;
+
+import org.apache.ws.commons.om.OMAbstractFactory;
+import org.apache.ws.commons.om.OMElement;
+import org.apache.ws.commons.om.OMFactory;
+import org.apache.ws.commons.om.OMNamespace;
+
+import javax.xml.stream.XMLStreamException;
+
+public class AxisModules extends AbstractDMService {
+
+
+	public OMElement getInfo() throws XMLStreamException {
+		return packValue("This is the AxisModules module management web module.");
+	}
+
+	
+	public OMElement getModuleParameters(OMElement element) throws XMLStreamException {
+
+		String[] params = getParameters(element);
+		
+		ModuleManager moduleManager = getModuleManager();
+		String[] moduleParameters = moduleManager.getModuleParameters(params[0]);
+
+		return packValues(moduleParameters);
+	}
+
+
+	public OMElement isModuleParameter(OMElement element) {
+
+		String[] params = getParameters(element);
+
+		ModuleManager moduleManager = getModuleManager();
+		boolean available = moduleManager.isModuleParameter(params[0], params[1]);
+
+		OMElement result;
+		if(available)
+			result = packValue("TRUE");
+		else
+			result = packValue("FALSE");
+
+		return result;
+	}
+
+
+	public OMElement addModuleParameter(OMElement element) throws XMLStreamException {
+
+		String[] params = getParameters(element);
+		
+		ModuleManager moduleManager = getModuleManager();
+		moduleManager.addModuleParameter(params[0], params[1], params[2]);
+
+		return packValue("OUT NOT AVAILABLE");
+	}
+
+
+	public OMElement editModuleParameter(OMElement element) throws XMLStreamException {
+
+		String[] params = getParameters(element);
+		
+		ModuleManager moduleManager = getModuleManager();
+		String result = moduleManager.editModuleParameter(params[0], params[1], params[2]);
+
+		return packValue(result);
+	}
+	
+	
+	public OMElement isEngagedGlobally(OMElement element) throws XMLStreamException {
+
+		String[] params = getParameters(element);
+		
+		ModuleManager moduleManager = getModuleManager();
+		boolean engaged = moduleManager.isEngagedGlobally(params[0]);
+
+		OMElement result;
+		if(engaged)
+			result = packValue("TRUE");
+		else
+			result = packValue("FALSE");
+
+		return result;
+	}
+	
+	
+	public OMElement getEngagedServices(OMElement element) throws XMLStreamException {
+
+		String[] params = getParameters(element);
+		
+		ModuleManager moduleManager = getModuleManager();
+		String[] engagedServices = moduleManager.getEngagedServices(params[0]);
+
+		return packValues(engagedServices);
+	}
+	
+	
+	public OMElement getEngagedOperations(OMElement element) throws XMLStreamException {
+
+		String[] params = getParameters(element);
+		
+		ModuleManager moduleManager = getModuleManager();
+		String[] engagedOperations = moduleManager.getEngagedOperations(params[0]);
+
+		return packValues(engagedOperations);
+	}
+
+}

Modified: webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AxisOperationStats.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AxisOperationStats.java?rev=390425&r1=390424&r2=390425&view=diff
==============================================================================
--- webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AxisOperationStats.java (original)
+++ webservices/axis2/trunk/archive/java/scratch/Axis_Management_module/management/src/org/apache/axis2/management/interfaces/ws/AxisOperationStats.java Fri Mar 31 06:20:02 2006
@@ -1,77 +1,79 @@
-package org.apache.axis2.management.interfaces.ws;
-
-import org.apache.axis2.management.core.managers.DynamicStatsManager;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.ConfigurationContext;
-
-import org.apache.ws.commons.om.OMAbstractFactory;
-import org.apache.ws.commons.om.OMElement;
-import org.apache.ws.commons.om.OMFactory;
-import org.apache.ws.commons.om.OMNamespace;
-
-import javax.xml.stream.XMLStreamException;
-
-public class AxisOperationStats extends AbstractDMService {
-
-	private MessageContext msgContext = null;
-	private ConfigurationContext configContext = null;
-
-	public void init(MessageContext context) {
-		msgContext = context;
-		configContext = context.getConfigurationContext();
-	}
-
-
-	public OMElement getInfo() throws XMLStreamException {
-
-		System.out.println("INFO: " + msgContext.getAxisService().getName());
-
-		return packValue("This is the AxisOperationStats service.");
-	}
-	
-
-	public void setOperationToMonitor(OMElement element) throws XMLStreamException {
-		
-		String[] params = getParameters(element);
-		
-		DynamicStatsManager dynamicStatsManager = (DynamicStatsManager)configContext.getProperty("dynamic_stats");
-		
-		if(!dynamicStatsManager.isServiceMonitoring(params[0])) {
-			dynamicStatsManager.setServiceToMonitor(params[0]);
-		}
-		
-		try {
-			dynamicStatsManager.getMonitoredService(params[0]).setOperationToMonitor(params[1]);
-		} catch(AxisFault af) {System.out.println("===== EXCEPTION: " + af.getMessage() + "=====");}
-	}
-	
-	
-	public OMElement getInMessages(OMElement element) throws XMLStreamException {
-		
-		String[] params = getParameters(element);
-		
-		DynamicStatsManager dynamicStatsManager = (DynamicStatsManager)configContext.getProperty("dynamic_stats");
-		
-		int totalRequests = 0;
-		try {
-			totalRequests = dynamicStatsManager.getMonitoredService(params[0]).getMonitoredOperation(params[1]).getInMessages();
-		} catch(AxisFault af) {System.out.println("===== EXCEPTION: " + af.getMessage() + "=====");}
-
-		return packValue(new Integer(totalRequests).toString());
-	}
-	
-	
-	public void clearInMessages(OMElement element) throws XMLStreamException {
-		
-		String[] params = getParameters(element);
-		int totalRequests = 0;
-		
-		DynamicStatsManager dynamicStatsManager = (DynamicStatsManager)configContext.getProperty("dynamic_stats");
-		
-		try {
-			dynamicStatsManager.getMonitoredService(params[0]).getMonitoredOperation(params[1]).clearInMessages();
-		} catch(AxisFault af) {System.out.println("===== EXCEPTION: " + af.getMessage() + "=====");}
-	}
-}
+package org.apache.axis2.management.interfaces.ws;
+
+import org.apache.axis2.management.core.managers.DynamicStatsManager;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.ConfigurationContext;
+
+import org.apache.ws.commons.om.OMAbstractFactory;
+import org.apache.ws.commons.om.OMElement;
+import org.apache.ws.commons.om.OMFactory;
+import org.apache.ws.commons.om.OMNamespace;
+
+import javax.xml.stream.XMLStreamException;
+
+public class AxisOperationStats extends AbstractDMService {
+
+	private MessageContext msgContext = null;
+	private ConfigurationContext configContext = null;
+
+	public void init(MessageContext context) {
+		msgContext = context;
+		configContext = context.getConfigurationContext();
+	}
+
+
+	public OMElement getInfo() throws XMLStreamException {
+
+		System.out.println("INFO: " + msgContext.getAxisService().getName());
+
+		return packValue("This is the AxisOperationStats service.");
+	}
+	
+
+	public OMElement setOperationToMonitor(OMElement element) throws XMLStreamException {
+		
+		String[] params = getParameters(element);
+		
+		DynamicStatsManager dynamicStatsManager = (DynamicStatsManager)configContext.getProperty("dynamic_stats");
+		
+		if(!dynamicStatsManager.isServiceMonitoring(params[0])) {
+			dynamicStatsManager.setServiceToMonitor(params[0]);
+		}
+		
+		try {
+			dynamicStatsManager.getMonitoredService(params[0]).setOperationToMonitor(params[1]);
+		} catch(AxisFault af) {System.out.println("===== EXCEPTION: " + af.getMessage() + "=====");}
+		
+		return packValue("Successfully completed the operation.");
+	}
+	
+	
+	public OMElement getInMessages(OMElement element) throws XMLStreamException {
+		
+		String[] params = getParameters(element);
+		
+		DynamicStatsManager dynamicStatsManager = (DynamicStatsManager)configContext.getProperty("dynamic_stats");
+		
+		int totalRequests = 0;
+		try {
+			totalRequests = dynamicStatsManager.getMonitoredService(params[0]).getMonitoredOperation(params[1]).getInMessages();
+		} catch(AxisFault af) {System.out.println("===== EXCEPTION: " + af.getMessage() + "=====");}
+
+		return packValue(new Integer(totalRequests).toString());
+	}
+	
+	
+	public void clearInMessages(OMElement element) throws XMLStreamException {
+		
+		String[] params = getParameters(element);
+		int totalRequests = 0;
+		
+		DynamicStatsManager dynamicStatsManager = (DynamicStatsManager)configContext.getProperty("dynamic_stats");
+		
+		try {
+			dynamicStatsManager.getMonitoredService(params[0]).getMonitoredOperation(params[1]).clearInMessages();
+		} catch(AxisFault af) {System.out.println("===== EXCEPTION: " + af.getMessage() + "=====");}
+	}
+}



Mime
View raw message