[dna-commits] DNA SVN: r342 - in trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph: commands and 1 other directory.

dna-commits at lists.jboss.org dna-commits at lists.jboss.org
Wed Jul 9 10:45:35 EDT 2008


Author: rhauch
Date: 2008-07-09 10:45:35 -0400 (Wed, 09 Jul 2008)
New Revision: 342

Modified:
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/PathNotFoundException.java
   trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/ActsOnPath.java
Log:
DNA-115 - Create federation service 
http://jira.jboss.com/jira/browse/DNA-115

Changed type of exception thrown when attempting to retrieve or use a node on a path does not exist. 

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/PathNotFoundException.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/PathNotFoundException.java	2008-07-09 14:44:53 UTC (rev 341)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/PathNotFoundException.java	2008-07-09 14:45:35 UTC (rev 342)
@@ -30,35 +30,45 @@
      */
     private static final long serialVersionUID = -3703984046286975978L;
 
+    private final Path path;
+
     /**
-     * 
+     * @param path
      */
-    public PathNotFoundException() {
+    public PathNotFoundException( Path path ) {
+        this.path = path;
     }
 
     /**
+     * @param path
      * @param message
      */
-    public PathNotFoundException( String message ) {
+    public PathNotFoundException( Path path,
+                                  String message ) {
         super(message);
-
+        this.path = path;
     }
 
     /**
+     * @param path
      * @param cause
      */
-    public PathNotFoundException( Throwable cause ) {
+    public PathNotFoundException( Path path,
+                                  Throwable cause ) {
         super(cause);
-
+        this.path = path;
     }
 
     /**
+     * @param path
      * @param message
      * @param cause
      */
-    public PathNotFoundException( String message, Throwable cause ) {
+    public PathNotFoundException( Path path,
+                                  String message,
+                                  Throwable cause ) {
         super(message, cause);
-
+        this.path = path;
     }
 
     /**
@@ -68,4 +78,13 @@
     public String toString() {
         return super.toString();
     }
+
+    /**
+     * Get the path that was not found
+     * 
+     * @return the path that was not found
+     */
+    public Path getPath() {
+        return path;
+    }
 }

Modified: trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/ActsOnPath.java
===================================================================
--- trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/ActsOnPath.java	2008-07-09 14:44:53 UTC (rev 341)
+++ trunk/dna-spi/src/main/java/org/jboss/dna/spi/graph/commands/ActsOnPath.java	2008-07-09 14:45:35 UTC (rev 342)
@@ -22,16 +22,20 @@
 package org.jboss.dna.spi.graph.commands;
 
 import org.jboss.dna.spi.graph.Path;
+import org.jboss.dna.spi.graph.PathNotFoundException;
 
 /**
  * Aspect interface for any repository command that acts upon a specific path. This aspect adds a method that can be used by the
  * recipient to obtain the path that the command applies to.
+ * 
  * @author Randall Hauch
  */
 public interface ActsOnPath {
 
     /**
-     * Get the path to which this command applies.
+     * Get the path to which this command applies. If the path does not exist, an {@link PathNotFoundException} exception should
+     * be recorded as an {@link GraphCommand#setError(Throwable) error}.
+     * 
      * @return the path; never null
      */
     Path getPath();




More information about the dna-commits mailing list