use of jakarta.enterprise.inject.Any in project security by jakartaee.
the class BasicServlet2 method doGet.
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("Inside BasicServlet ....." + "<BR>");
response.getWriter().write("This is a servlet \n");
try {
BeanManager bm = CDI.current().getBeanManager();
Set<Bean<?>> beans = bm.getBeans(HttpAuthenticationMechanism.class, new AnnotationLiteral<Any>() {
});
for (Bean<?> bean : beans) {
response.getWriter().println("Class: " + bean.getBeanClass().getName());
response.getWriter().println("Qualifier: " + split(bean.getQualifiers()));
response.getWriter().println("Scope: " + bean.getScope().getSimpleName());
response.getWriter().println("Have qualifier @Default: " + haveQualifierDefault(bean.getQualifiers()));
response.getWriter().println("Have scope @ApplicationScoped: " + (bean.getScope() == ApplicationScoped.class));
}
} catch (Exception e) {
throw new ServletException(e);
}
}
use of jakarta.enterprise.inject.Any in project security by jakartaee.
the class FormServlet2 method doGet.
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("Inside FormServlet ....." + "<BR>");
response.getWriter().write("This is a servlet \n");
try {
BeanManager bm = CDI.current().getBeanManager();
Set<Bean<?>> beans = bm.getBeans(HttpAuthenticationMechanism.class, new AnnotationLiteral<Any>() {
});
for (Bean<?> bean : beans) {
response.getWriter().println("Class: " + bean.getBeanClass().getName());
response.getWriter().println("Types: " + bean.getTypes().toString());
response.getWriter().println("Qualifier: " + split(bean.getQualifiers()));
response.getWriter().println("Scope: " + bean.getScope().getSimpleName());
response.getWriter().println("Have qualifier @Default: " + haveQualifierDefault(bean.getQualifiers()));
response.getWriter().println("Have scope @ApplicationScoped: " + (bean.getScope() == ApplicationScoped.class));
}
} catch (Exception e) {
throw new ServletException(e);
}
}
use of jakarta.enterprise.inject.Any in project security by jakartaee.
the class Servlet2 method doGet.
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("Inside Servlet2 ....." + "<BR>");
response.getWriter().write("This is a servlet \n");
try {
BeanManager bm = CDI.current().getBeanManager();
Set<Bean<?>> beans = bm.getBeans(HttpAuthenticationMechanism.class, new AnnotationLiteral<Any>() {
});
for (Bean<?> bean : beans) {
response.getWriter().println("Class: " + bean.getBeanClass().getName());
response.getWriter().println("Types: " + bean.getTypes().toString());
response.getWriter().println("Qualifier: " + split(bean.getQualifiers()));
response.getWriter().println("Scope: " + bean.getScope().getSimpleName());
response.getWriter().println("Have qualifier @Default: " + haveQualifierDefault(bean.getQualifiers()));
response.getWriter().println("Have scope @ApplicationScoped: " + (bean.getScope() == ApplicationScoped.class));
}
} catch (Exception e) {
throw new ServletException(e);
}
}
Aggregations