private static class EclipseProvider extends JavaServiceProvider {
public void findInitializer(ClassLoader loader, List<Object> initializers, String serviceType) {
// Load the global providers, from the platform
try {
IExtensionRegistry reg = org.eclipse.core.runtime.Platform.getExtensionRegistry();
if (reg != null) {
// Services defined individually
// Look if someone implemented an extension point to retrieve the platform
IConfigurationElement[] elt = reg.getConfigurationElementsFor("com.ibm.commons.Extension"); // $NON-NLS-1$
for( int i=0; i<elt.length; i++ ) {
if( "service".equalsIgnoreCase(elt[i].getName()) ) { // $NON-NLS-1$
String type = elt[i].getAttribute("type"); //$NON-NLS-1$
if(StringUtil.equals(type, serviceType)) {
try {
Object o = elt[i].createExecutableExtension("class"); // $NON-NLS-1$
initializers.add(o);
} catch(Throwable ex) {
logCouldNotCreateContribution(ex, elt[i], type);
}
}
}
}
// Services read from META-INF/services
//
Set<URL> urls = new HashSet<URL>();
elt = reg.getConfigurationElementsFor("com.ibm.commons.ExtensionBundle"); // $NON-NLS-1$
for( int i=0; i<elt.length; i++ ) {
try {
OSGiExtensionService o = (OSGiExtensionService)elt[i].createExecutableExtension("class");
Bundle bundle = o.getBundle();
if(bundle!=null) {