[MOBY-guts] biomoby commit

Paul Gordon gordonp at pub.open-bio.org
Fri Apr 2 16:40:23 UTC 2004


gordonp
Fri Apr  2 11:40:23 EST 2004
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared
In directory pub.open-bio.org:/tmp/cvs-serv13318/src/main/org/biomoby/shared

Modified Files:
	Central.java Utils.java 
Log Message:
Revised documentation, interfaces and classes pertaining to XML parsing and server cache to reflect new parsing and caching schemes

moby-live/Java/src/main/org/biomoby/shared Central.java,1.3,1.4 Utils.java,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java	2003/11/25 13:18:11	1.3
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java	2004/04/02 16:40:23	1.4
@@ -323,4 +323,15 @@
      *************************************************************************/
     void setDebug (boolean debug);
 
+    /**************************************************************************
+     * Set whether the server responses should cached or not to speedup 
+     * multiple calls for the same data.   
+     * @param shouldCache if set to false, any previously cached documents should be deleted
+     *************************************************************************/
+    void setCacheMode(boolean shouldCache); 
+
+    /**************************************************************************
+     * Reports whether server responses are being cached or not.
+     *************************************************************************/
+    boolean getCacheMode();
 }

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java	2003/11/25 13:18:11	1.3
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java	2004/04/02 16:40:23	1.4
@@ -7,8 +7,6 @@
 
 package org.biomoby.shared;
 
-import org.biomoby.shared.dom.*;
-
 import org.apache.axis.AxisFault;
 import javax.xml.namespace.QName;
 import java.io.*;
@@ -24,16 +22,6 @@
 
 public abstract class Utils {
 
-    /** Java property name ('dom.parser').
-     *  The property value is a fully qualified name of a class of type
-     *  <tt>org.biomoby.shared.dom.ParserWrapper</tt>.
-     */
-    public static final String PROP_PARSER_WRAPPER = "dom.parser";
-
-    /** Default parser wrapper. */
-    public static final String DEFAULT_PARSER_WRAPPER =
-	"org.biomoby.shared.dom.wrappers.Xerces";
-
     /*************************************************************************
      * Format an exception 'e' and return it back.
      *<p>
@@ -122,72 +110,6 @@
     }
 
     /*************************************************************************
-     * Find and return an instance of a DOM parser wrapper. A parser
-     * wrapper is a class allowing a uniform access to DOM parsers -
-     * because it defines a way how a Document is created and returned
-     * (see details in interface
-     * <tt>org.biomoby.shared.dom.ParseWrappers</tt>, or in samples in
-     * the distribution of Apache Xerces-2 where this is all taken
-     * from).
-     *<p>
-     *
-     * The DOM parser wrapper class name is taken from, in this order:
-     * <ol>
-     *  <li> Java property {@link #PROP_PARSER_WRAPPER}
-     *  <li> parameter <tt>parserClassName</tt>
-     *  <li> default value {@link #DEFAULT_PARSER_WRAPPER}
-     * </ol>
-     *<p>
-     *
-     * This is based on the samples shown int the Apache Xerces-2 distribution.
-     * See more details there. This implementation differ from those samples
-     * in few not too crucial details:
-     * <ul>
-     *  <li> It can take parser class name also from a Java property
-     *       ({@link #DEFAULT_PARSER_WRAPPER})
-     *  <li> It raises Moby specific exception
-     * </ul>
-     *<p>
-     * @param parserClassName is a class to be instatiated (unless there is
-     *        a Java property {@link #PROP_PARSER_WRAPPER})
-     * @return an instance of a DOM parser wrapper
-     * @throws MobyException if unable to instantiate specified DOM parser
-     *************************************************************************/
-    public static ParserWrapper getDOMParser (String parserClassName)
-	throws MobyException {
-
-	// which parser do we want
-	String name = System.getProperty (PROP_PARSER_WRAPPER);
-	if (name != null)
-	    parserClassName = name;
-	if (parserClassName == null)
-	    parserClassName = DEFAULT_PARSER_WRAPPER;
-
-	// create parser
-	try {
-	    return (ParserWrapper)Class.forName (parserClassName).newInstance();
-	}
-	catch (Exception e) {
-	    throw new MobyException ("Unable to instantiate parser (" + parserClassName +")");
-	}
-    }
-
-    /*************************************************************************
-     * Find and return an instance of a DOM parser wrapper.
-     * It does the same as method {@link #getDOMParser(String)} except that it
-     * does not get any parser class name in the parameter.
-     * <p>
-     *
-     * @return an instance of a DOM parser wrapper
-     * @see #getDOMParser(String)
-     * @throws MobyException if unable to instantiate the specified DOM parser
-     *************************************************************************/
-    public static ParserWrapper getDOMParser()
-	throws MobyException {
-	return getDOMParser (null);
-    }
-
-    /*************************************************************************
      * Return just the last part of the LSID identifier. An example of
      * an LSID identifier as used by and returned from the Moby
      * registry is <tt>urn:lsid:biomoby.org:objectclass:object</tt>.




More information about the MOBY-guts mailing list