final IIORegistry ioRegistry = IIORegistry.getDefaultInstance();
Set<IIOServiceProvider> providersToUnload = new HashSet();
for(Iterator<Class<?>> cats = ioRegistry.getCategories(); cats.hasNext(); ) {
Class<?> category = cats.next();
for (Iterator it = ioRegistry.getServiceProviders(category, false); it.hasNext();) {
final IIOServiceProvider provider = (IIOServiceProvider) it.next();
if(webappClassLoader.equals(provider.getClass().getClassLoader())) {
providersToUnload.add(provider);
}
}
}
for (IIOServiceProvider provider : providersToUnload) {