HandlesTypes handlesTypes = servletContainerInitializerClass.getAnnotation(HandlesTypes.class);
if (handlesTypes == null || handlesTypes.value().length == 0) {
servletContainerInitializerClassNamesMap.put(servletContainerInitializer, null);
continue;
}
BundleClassFinder bundleClassFinder = new BundleAssignableClassFinder(packageAdmin, bundle, handlesTypes.value(), new ClassDiscoveryFilter() {
@Override
public boolean directoryDiscoveryRequired(String directory) {
return true;
}
@Override
public boolean jarFileDiscoveryRequired(String jarUrl) {
return !excludedJarNames.contains(jarUrl);
}
@Override
public boolean packageDiscoveryRequired(String packageName) {
return true;
}
@Override
public boolean rangeDiscoveryRequired(DiscoveryRange discoveryRange) {
return discoveryRange.equals(DiscoveryRange.BUNDLE_CLASSPATH);
}
});
Set<String> acceptedClassNames = bundleClassFinder.find();
servletContainerInitializerClassNamesMap.put(servletContainerInitializer, acceptedClassNames.size() > 0 ? acceptedClassNames : null);
}
module.getEarContext().getGeneralData().put(AbstractWebModuleBuilder.SERVLET_CONTAINER_INITIALIZERS, servletContainerInitializerClassNamesMap);
} catch (Exception e) {
throw new DeploymentException("Fail to scan javax.servlet.ServletContainerInitializer", e);