geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r582183 - in /geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout: DefaultLayoutManager.java LayoutException.java LayoutManager.java NotFoundException.java
Date Fri, 05 Oct 2007 09:59:09 GMT
Author: jdillon
Date: Fri Oct  5 02:59:07 2007
New Revision: 582183

URL: http://svn.apache.org/viewvc?rev=582183&view=rev
Log:
Add NotFoundException to find()

Added:
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/LayoutException.java
      - copied, changed from r582153, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/registry/RegistryException.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/NotFoundException.java
      - copied, changed from r582153, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/registry/NotRegisteredException.java
Modified:
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/DefaultLayoutManager.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/LayoutManager.java

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/DefaultLayoutManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/DefaultLayoutManager.java?rev=582183&r1=582182&r2=582183&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/DefaultLayoutManager.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/DefaultLayoutManager.java
Fri Oct  5 02:59:07 2007
@@ -23,6 +23,7 @@
 import org.apache.geronimo.gshell.layout.loader.LayoutLoader;
 import org.apache.geronimo.gshell.layout.model.Layout;
 import org.apache.geronimo.gshell.registry.CommandRegistry;
+import org.apache.geronimo.gshell.registry.NotRegisteredException;
 import org.apache.geronimo.gshell.shell.Environment;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
@@ -78,7 +79,7 @@
         return layout;
     }
 
-    public Command find(final String path) {
+    public Command find(final String path) throws NotFoundException {
         assert path != null;
 
         log.debug("Searching for command for path: {}", path);
@@ -87,6 +88,11 @@
         // HACK: For now, assume the path is just the id... should eventually change this
         //
 
-        return commandRegistry.lookup(path);
+        try {
+            return commandRegistry.lookup(path);
+        }
+        catch (NotRegisteredException e) {
+            throw new NotFoundException(e.getMessage());
+        }
     }
 }

Copied: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/LayoutException.java
(from r582153, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/registry/RegistryException.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/LayoutException.java?p2=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/LayoutException.java&p1=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/registry/RegistryException.java&r1=582153&r2=582183&rev=582183&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/registry/RegistryException.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/LayoutException.java
Fri Oct  5 02:59:07 2007
@@ -17,31 +17,31 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.registry;
+package org.apache.geronimo.gshell.layout;
 
 /**
  * ???
  *
  * @version $Rev$ $Date$
  */
-public class RegistryException
+public class LayoutException
     extends Exception
 {
     ///CLOVER:OFF
 
-    public RegistryException(final String msg) {
+    public LayoutException(final String msg) {
         super(msg);
     }
 
-    public RegistryException(final String msg, final Throwable cause) {
+    public LayoutException(final String msg, final Throwable cause) {
         super(msg, cause);
     }
 
-    public RegistryException(final Throwable cause) {
+    public LayoutException(final Throwable cause) {
         super(cause);
     }
 
-    public RegistryException() {
+    public LayoutException() {
         super();
     }
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/LayoutManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/LayoutManager.java?rev=582183&r1=582182&r2=582183&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/LayoutManager.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/LayoutManager.java
Fri Oct  5 02:59:07 2007
@@ -37,5 +37,5 @@
     /**
      * Find the command for the given path, or null if not found.
      */
-    Command find(String path);
+    Command find(String path) throws NotFoundException;
 }

Copied: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/NotFoundException.java
(from r582153, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/registry/NotRegisteredException.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/NotFoundException.java?p2=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/NotFoundException.java&p1=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/registry/NotRegisteredException.java&r1=582153&r2=582183&rev=582183&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/registry/NotRegisteredException.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/NotFoundException.java
Fri Oct  5 02:59:07 2007
@@ -17,19 +17,19 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.registry;
+package org.apache.geronimo.gshell.layout;
 
 /**
  * ???
  *
  * @version $Rev$ $Date$
  */
-public class NotRegisteredException
-    extends RegistryException
+public class NotFoundException
+    extends LayoutException
 {
     ///CLOVER:OFF
 
-    public NotRegisteredException(final String msg) {
+    public NotFoundException(final String msg) {
         super(msg);
     }
 }



Mime
View raw message