[Mulgara-svn] r435 - branches/nw-interface/src/jar/query/java/org/mulgara/query/operation

pag at mulgara.org pag at mulgara.org
Thu Sep 13 20:38:38 UTC 2007


Author: pag
Date: 2007-09-13 15:38:37 -0500 (Thu, 13 Sep 2007)
New Revision: 435

Modified:
   branches/nw-interface/src/jar/query/java/org/mulgara/query/operation/LocalCommand.java
   branches/nw-interface/src/jar/query/java/org/mulgara/query/operation/Quit.java
Log:
Added methods to discover class types, thereby avoiding having to use (x instanceof Quit)

Modified: branches/nw-interface/src/jar/query/java/org/mulgara/query/operation/LocalCommand.java
===================================================================
--- branches/nw-interface/src/jar/query/java/org/mulgara/query/operation/LocalCommand.java	2007-09-13 20:37:11 UTC (rev 434)
+++ branches/nw-interface/src/jar/query/java/org/mulgara/query/operation/LocalCommand.java	2007-09-13 20:38:37 UTC (rev 435)
@@ -36,6 +36,14 @@
   }
 
   /**
+   * Queries if this command is a request to quit.
+   * @return <code>false</code> for most operations, but <code>true</code> if quitting.
+   */
+  public boolean isQuitCommand() {
+    return false;
+  }
+
+  /**
    * Gets the associated server for a non-local operation.
    * @throws UnsupportedOperationException Always thrown for local commands.
    */

Modified: branches/nw-interface/src/jar/query/java/org/mulgara/query/operation/Quit.java
===================================================================
--- branches/nw-interface/src/jar/query/java/org/mulgara/query/operation/Quit.java	2007-09-13 20:37:11 UTC (rev 434)
+++ branches/nw-interface/src/jar/query/java/org/mulgara/query/operation/Quit.java	2007-09-13 20:38:37 UTC (rev 435)
@@ -43,4 +43,11 @@
     return finalMessage;
   }
 
+  /**
+   * Indicates that this command is a request to quit.
+   * @return <code>true</code> to indicate that a client should quit.
+   */
+  public boolean isQuitCommand() {
+    return true;
+  }
 }




More information about the Mulgara-svn mailing list