You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by fm...@apache.org on 2008/01/23 15:36:40 UTC

svn commit: r614550 - /incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/impl/ServiceLocatorImpl.java

Author: fmeschbe
Date: Wed Jan 23 06:36:37 2008
New Revision: 614550

URL: http://svn.apache.org/viewvc?rev=614550&view=rev
Log:
SLING-186 Fix exception handling

Modified:
    incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/impl/ServiceLocatorImpl.java

Modified: incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/impl/ServiceLocatorImpl.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/impl/ServiceLocatorImpl.java?rev=614550&r1=614549&r2=614550&view=diff
==============================================================================
--- incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/impl/ServiceLocatorImpl.java (original)
+++ incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/impl/ServiceLocatorImpl.java Wed Jan 23 06:36:37 2008
@@ -26,7 +26,6 @@
 
 import org.apache.sling.api.services.InvalidServiceFilterSyntaxException;
 import org.apache.sling.api.services.ServiceLocator;
-import org.apache.sling.api.services.ServiceNotAvailableException;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
@@ -53,19 +52,6 @@
     }
 
     /**
-     * @see org.apache.sling.api.services.ServiceLocator#getRequiredService(java.lang.Class)
-     */
-    public <ServiceType> ServiceType getRequiredService(Class<ServiceType> type)
-            throws ServiceNotAvailableException {
-        final ServiceType service = this.getService(type);
-        if (service == null) {
-            throw new ServiceNotAvailableException("Service " + type.getName()
-                + " is not available.");
-        }
-        return service;
-    }
-
-    /**
      * @see org.apache.sling.api.services.ServiceLocator#getService(java.lang.Class)
      */
     @SuppressWarnings("unchecked")
@@ -109,8 +95,8 @@
             }
             return result;
         } catch (InvalidSyntaxException ise) {
-            throw new InvalidServiceFilterSyntaxException(
-                "Invalid filter syntax: " + filter, ise);
+            throw new InvalidServiceFilterSyntaxException(filter,
+                "Invalid filter syntax", ise);
         }
     }