[MOBY-guts] biomoby commit

Martin Senger senger at dev.open-bio.org
Sun Mar 2 12:45:26 UTC 2008


senger
Sun Mar  2 07:45:26 EST 2008
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared
In directory dev.open-bio.org:/tmp/cvs-serv32345/src/main/org/biomoby/shared

Modified Files:
	MobyException.java MobyResourceRef.java MobyService.java 
Log Message:
Too Many Changes - see docs/ChangeLog

moby-live/Java/src/main/org/biomoby/shared MobyException.java,1.4,1.5 MobyResourceRef.java,1.4,1.5 MobyService.java,1.23,1.24
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyException.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/shared/MobyException.java	2005/11/15 03:25:51	1.4
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyException.java	2008/03/02 12:45:26	1.5
@@ -47,20 +47,8 @@
     public MobyException (String s, Throwable e) {
 	super (s, e);
 	if (e != null) {
-	    boolean seriousError =
-		( (e instanceof java.lang.NullPointerException)              ||
-		  (e instanceof java.lang.ClassCastException)                ||
-		  (e instanceof java.lang.reflect.InvocationTargetException) ||
-		  (e instanceof java.lang.ClassNotFoundException) );
-	    if (seriousError || log.isDebugEnabled()) {
-		StringWriter sw = new StringWriter (500);
-		e.printStackTrace (new PrintWriter (sw));
-		if (seriousError)
-		    log.error (sw.toString());
-		else
-		    log.debug (sw.toString());
-	    }
-	}
+ 	    formatAndLog (e, log);
+ 	}
     }
 
     /******************************************************************************
@@ -75,4 +63,28 @@
 	return getCause();
     }
 
+    /******************************************************************************
+     * Format given exception 'e' depending on how serious it it. In
+     * same cases add stack trace. Log the result in the given
+     * 'log'. <p>
+     *
+     * @param e an exception to be formatted and logged
+     * @param log where to log it
+     ******************************************************************************/
+    public static void formatAndLog (Throwable e,
+				     org.apache.commons.logging.Log log) {
+	boolean seriousError =
+	    (e instanceof java.lang.RuntimeException);
+	if (seriousError || log.isDebugEnabled()) {
+	    StringWriter sw = new StringWriter (500);
+	    e.printStackTrace (new PrintWriter (sw));
+	    if (seriousError)
+		log.error (sw.toString());
+	    else
+		log.debug (sw.toString());
+	} else {
+	    log.error (e.getMessage());
+	}
+    }
+    
 }

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyResourceRef.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/shared/MobyResourceRef.java	2006/07/07 23:27:27	1.4
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyResourceRef.java	2008/03/02 12:45:26	1.5
@@ -65,7 +65,11 @@
     }
 
     /**
-     * Return resource content type.
+     * Return resource content type. 
+     *
+     * @deprecated Biomoby registry never gives the content type
+     * back. Therefore, this method does not have anything reasonable
+     * to return.
      */
     public String getResourceContentType() {
 	return contentType;

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java	2008/01/07 22:01:09	1.23
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/MobyService.java	2008/03/02 12:45:26	1.24
@@ -67,6 +67,13 @@
     /** Name of a category for asynchornous BioMoby services. */
     public static final String CATEGORY_MOBY_ASYNC = "moby-async";
 
+    /** Name of a category for document/literal BioMoby services. */
+    public static final String CATEGORY_MOBY_DOCLIT = "doc-literal";
+
+    /** Name of a category for asynchronous document/literal BioMoby
+     * services. */
+    public static final String CATEGORY_MOBY_DOCLIT_ASYNC = "doc-literal-async";
+
     /** A suffix added to a service name in order to make a method
      * name that submits input to an asynchronous service.
      */
@@ -601,6 +608,8 @@
     }
 
     public boolean isAsynchronous(){
-	return category.equals (CATEGORY_MOBY_ASYNC);
+	return
+	    category.equals (CATEGORY_MOBY_ASYNC) ||
+	    category.equals (CATEGORY_MOBY_DOCLIT_ASYNC);
     }
 }




More information about the MOBY-guts mailing list