in cdi-extension-servlet-common/src/main/java/org/apache/aries/cdi/extension/servlet/common/BaseServletExtension.java [160:211]
void webServlet(
@Observes @FiltersOn(annotations = WebServlet.class) ProcessPotentialService pat,
BeanManager beanManager) {
beanManager.fireEvent(MergeServiceTypes.forEvent(pat).withTypes(Servlet.class).build());
final AnnotatedTypeConfigurator<?> configurator = pat.configureAnnotatedType();
final AnnotatedType<?> annotatedType = pat.getAnnotatedType();
WebServlet webServlet = annotatedType.getAnnotation(WebServlet.class);
if (!annotatedType.isAnnotationPresent(HttpWhiteboardContextSelect.class)) {
ofNullable((String) configuration.get(HTTP_WHITEBOARD_CONTEXT_SELECT)).ifPresent(
select -> configurator.add(HttpWhiteboardContextSelect.Literal.of(select))
);
}
if (!annotatedType.isAnnotationPresent(HttpWhiteboardServletName.class) && !webServlet.name().isEmpty()) {
configurator.add(HttpWhiteboardServletName.Literal.of(webServlet.name()));
}
if (!annotatedType.isAnnotationPresent(HttpWhiteboardServletPattern.class)) {
if (webServlet.value().length > 0) {
configurator.add(HttpWhiteboardServletPattern.Literal.of(webServlet.value()));
} else if (webServlet.urlPatterns().length > 0) {
configurator.add(HttpWhiteboardServletPattern.Literal.of(webServlet.urlPatterns()));
}
}
if (!annotatedType.isAnnotationPresent(ServiceRanking.class)) {
configurator.add(ServiceRanking.Literal.of(webServlet.loadOnStartup()));
}
// TODO Howto: INIT PARAMS ???
if (!annotatedType.isAnnotationPresent(HttpWhiteboardServletAsyncSupported.class)) {
configurator.add(HttpWhiteboardServletAsyncSupported.Literal.of(webServlet.asyncSupported()));
}
if (!annotatedType.isAnnotationPresent(ServiceDescription.class) && !webServlet.description().isEmpty()) {
configurator.add(ServiceDescription.Literal.of(webServlet.description()));
}
if (!annotatedType.isAnnotationPresent(HttpWhiteboardServletMultipart.class)) {
MultipartConfig multipartConfig = annotatedType.getAnnotation(MultipartConfig.class);
if (multipartConfig != null) {
configurator.add(HttpWhiteboardServletMultipart.Literal.of(true, multipartConfig.fileSizeThreshold(), multipartConfig.location(), multipartConfig.maxFileSize(), multipartConfig.maxRequestSize()));
}
}
// TODO HowTo: ServletSecurity ???
}