Description
I have created a new Iterator - "private static class LookupProvidersIterator implements Iterator" for this method. The iterator needs to instantiates new objects and throws ServiceConfigurationError exception at runtime, so we have to use customized Iterator.
The flow:
1. call ClassLoader.getResourse(String) to get a set of provider-configuration files that related to the specified class.
2. The iterator parses all provider-configuration files to get the names of provider classes
- Provider-Configuration File spec: http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Provider Configuration File
3. In LookupProvidersIterator.next(), instantiate objects