serviceloader

How to make the java ServiceLoader work in a NetBeans 6.9 module application

Hi, I have troubles using the java ServiceLoader in a NetBeans module application. Here is what I'm trying to do (and it works in a normal java application in Eclipse): I have an interface.jar, which declares the interface. And I have implementations.jar, which has several implementations of this interface, all specified in the spi/MET...

How does Java ServiceLoader work during development time? (Unit test before building JARs?)

Java's ServiceLoader needs those entries to be present inside the JAR file. Is there a way to programatically add those service entries at runtime time for unit testing, when inside the IDE? Especially when the JARs are not built yet. ...

What else can be used in Java as the ServiceLoader alternative?

I'm looking for something like the ServiceLoader, but which does not depend on SPI file, where all the service implementations should be enumerated and then added to the path of some class loader, in order to be found. Let's say there is an application, that has the interface and some implementations of a service. What framework can be ...

Where to put ServiceLoader config file in a web app

I am writing a web app in Eclipse. I am trying to use the ServiceLoader class to load some plugins. The docs for ServiceLoader say I need to place a file in META-INF/services. I have placed the file in the WebContent/META-INF/service folder but when I run the JUnit test via Eclipse it does not find any plugins. Is this the correct lo...

How do I use the Java ServiceLoader class in Grails?

I've used the JDK's SPI mechanism in numerous other applications without any problem; however, I can't seem to get it to work within Grails. I've tried the usual code (shown below) both from within a static initializer, and from within a class constructor, but neither worked. ServiceLoader loader = ServiceLoader.load(QueryEngine.class)...