If we want to remain compatible with 1.5 we need to keep it since the ServiceLoader is new to Java 1.6 - otherwise I agree.
I think the Service Provider approach was my suggestion way back, but because it was an internal API to Sun's JREs someone (Greg probably?) wisely created this class to do the job instead. Also, I think this approach is likely to accommodate any use cases around the OSGi discussion we had previously though that is something I'd like to discuss a bit more after the 1.2 release. Cheers, Chris 2009/5/26 Todd Volkert <[email protected]> > FYI, http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4640520 was > the bug that brought Sun's internal implementation to the JDK. I see > that our Service class looks for system properties as well, so it > seems to add some value, but unless there are any strong objections, I > think we should change our Service class to call into the JDK > ServiceLoader when it comes to the META-INF/services facility. > > On Tue, May 26, 2009 at 3:18 PM, Todd Volkert <[email protected]> wrote: > > Reading through the Java service provider interface > > (http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html), I did some > > digging to see why Java hasn't provided the corresponding class, and > > it turns out they have > > (http://java.sun.com/javase/6/docs/api/java/util/ServiceLoader.html)! > > So the question is: what does pivot.util.Service provide that > > java.util.ServiceLoader doesn't? And can the META-INF/services > > portion of pivot.util.Service be made to use java.util.ServiceLoader? > > The JDK version supports the full spec, including correct handling of > > comments, whereas ours doesn't. This all came about because we should > > add a license header to our service provider configuration files, but > > right now, that chokes our parser :-( > > > > -T > > >
