geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r577062 - /geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/TransportFactoryLocator.java
Date Tue, 18 Sep 2007 21:01:05 GMT
Author: jdillon
Date: Tue Sep 18 14:01:04 2007
New Revision: 577062

URL: http://svn.apache.org/viewvc?rev=577062&view=rev
Log:
Use more specific exception

Modified:
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/TransportFactoryLocator.java

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/TransportFactoryLocator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/TransportFactoryLocator.java?rev=577062&r1=577061&r2=577062&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/TransportFactoryLocator.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/TransportFactoryLocator.java
Tue Sep 18 14:01:04 2007
@@ -24,6 +24,7 @@
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 
 /**
  * Helper to locate a {@link TransportFactory} instance.
@@ -36,14 +37,22 @@
     @Requirement
     private PlexusContainer container;
 
-    public TransportFactory locate(final URI location) throws Exception {
+    public TransportFactory locate(final URI location) throws MissingSchemeException, ComponentLookupException
{
         assert location != null;
 
         String scheme = location.getScheme();
         if (scheme == null) {
-            throw new Exception("Invalid location; missing scheme: " + location);
+            throw new MissingSchemeException(location);
         }
 
         return (TransportFactory) container.lookup(TransportFactory.class, scheme);
+    }
+
+    public static class MissingSchemeException
+        extends Exception
+    {
+        public MissingSchemeException(final URI location) {
+            super("Invalid location; missing scheme: " + location);
+        }
     }
 }



Mime
View raw message