I am using java.util.ServiceLoader to create a lightweight plugin framework.
I am currently wrestling with how to have multiple implementing classes with the same FQN. I would like to have two copies of the same plugin on the classpath and have access to both implementing classes given in the META-INF/services directory.
Here are some simple eclipse projects that illustrate what I mean: https://docs.google.com/open?id=0B4MxFm-ACB3IUmswN0dpMExTVms
ServiceLoaderIntf has the simple interface that is implemented by the plugins. ProjectOne and ProjectTwo represent the plugins. ServiceLoader has the Tester class which iterates through the implementors and calls the init() method on them.
How can I get it to recognize all implementors, even if the implementing classes have the same FQNs? Right now it just recognizes the plugin class in ProjectOne.