But wait…although the spec dates back from JDK 1.3, there’s no implementation in the JDK before 1.6? And what’s the mysterious Service class in the spec’s example?
Actually there are some implementations, well hidden in obscure JDK packages. Jackrabbit for example uses javax.imageio.spi.ServiceRegistry, which looks completely out of place in that package but is otherwise well specified. And apparently it is safe to use
javax packages in any VM.
For now, the final word of this story is Sun’s bug 4640520 – looks like
sun.misc.Service should have moved to the JDK public API long ago, but for some reason it didn’t.