}
}
}
URL[] urls = urlList.toArray(new URL[] {});
JarFileClassLoader tempClassLoader = null;
try {
tempClassLoader = new JarFileClassLoader(null, urls, parentClassLoader);
List<Class> classes = new ArrayList<Class>();
for (URL url : urlList) {
try {
ClassFinder classFinder = new ClassFinder(tempClassLoader, Collections.singletonList(url));
classes.addAll(classFinder.findAnnotatedClasses(WebService.class));
classes.addAll(classFinder.findAnnotatedClasses(WebServiceProvider.class));
} catch (Exception e) {
LOG.warn("Fail to search Web Service in jar [" + url + "]", e);
}
}
return classes;
} finally {
if (tempClassLoader != null)
try {
tempClassLoader.destroy();
} catch (Exception e) {
}
if (tmpDir != null) {
DeploymentUtil.recursiveDelete(tmpDir);
}