[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Wed Oct 18 22:31:06 UTC 2006


kawas
Wed Oct 18 18:31:06 EDT 2006
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms
In directory dev.open-bio.org:/tmp/cvs-serv27123/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms

Modified Files:
	CallableServicesServlet.java 
Log Message:

moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms CallableServicesServlet.java,1.4,1.5
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/CallableServicesServlet.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/CallableServicesServlet.java	2006/10/16 17:23:15	1.4
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ui/graphical/servlet/forms/CallableServicesServlet.java	2006/10/18 22:31:06	1.5
@@ -83,6 +83,8 @@
 		String authority = filter(request.getParameter("authority"));
 		String servicename = filter(request.getParameter("service"));
 		String getStats = filter(request.getParameter("getStats"));
+		String getDeadServices = filter(request.getParameter("getDeadServices"));
+		
 		if (getStats != null) {
 			response.setContentType("text/plain");
 			if (scheduler == null || scheduler.getServiceTester() == null) {
@@ -101,6 +103,25 @@
 				return;
 			}
 		}
+		
+		if (getDeadServices != null) {
+			response.setContentType("text/plain");
+			if (scheduler == null || scheduler.getServiceTester() == null) {
+				PrintWriter out = response.getWriter();
+				out.print("Sorry, I am unable to list the dead services at this time. Please try again in a few minutes(x0021).");
+				return;
+			} else {
+				if (scheduler.getServiceTester().getResultMap() == null
+						|| scheduler.getServiceTester().getResultMap().isEmpty()) {
+					PrintWriter out = response.getWriter();
+					out.print("Sorry, I am unable to list the dead services at this time. Please try again in a few minutes(x0022).");
+					return;
+				}
+				PrintWriter out = response.getWriter();
+				out.print(scheduler.getServiceTester().getDeadServicesByAuthority());
+				return;
+			}
+		}
 	
 		if (scheduler == null) {
 			response
@@ -190,7 +211,6 @@
 
 		public ServiceTesterRunner() {
 			try {
-				// TODO make this generic so that others can use it
 				t = new ServiceTester(
 						System.getProperty("MOBY_SERVER") == null ? CentralImpl.DEFAULT_ENDPOINT
 								: System.getProperty("MOBY_SERVER"),
@@ -206,6 +226,18 @@
 		 * Implements TimerTask's abstract run method.
 		 */
 		public void run() {
+			if (t == null) {
+				try {
+					t = new ServiceTester(
+							System.getProperty("MOBY_SERVER") == null ? CentralImpl.DEFAULT_ENDPOINT
+									: System.getProperty("MOBY_SERVER"),
+							System.getProperty("MOBY_URI") == null ? CentralImpl.DEFAULT_NAMESPACE
+									: System.getProperty("MOBY_URI"));
+				} catch (MobyException e) {
+					log.error("Couldn't instantiate a ServiceTester object", e);
+					return;
+				}
+			}
 			// implement this method to contain whatever it is you want to do
 			log.info("re-querying services...");
 			MobyService[] services = t.getServices();
@@ -216,6 +248,8 @@
 			}
 			services = null;
 			log.info("service checking complete!");
+			// log stats every hour
+			t.logStats();
 		}
 
 		public ServiceTester getServiceTester() {




More information about the MOBY-guts mailing list