use of org.jboss.security.client.SecurityClient in project wildfly by wildfly.
the class EJBServletEar method processRequest.
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
SecurityClient client = null;
try {
InitialContext ctx = new InitialContext();
client = SecurityClientFactory.getSecurityClient();
client.setSimple("user1", "password1");
client.login();
injectedSession.hello();
injectedSession.goodbye();
injectedStateless.hello();
injectedStateless.goodbye();
String lookupString = "java:app/ejb3-ear-servlet-ejbs/Session30!";
EJBServletHelper test = new EJBServletHelper();
test.processRequest(lookupString, ctx);
} catch (Exception e) {
log.error(e);
throw new ServletException("Failed to call EJBs/Session30 through remote and local interfaces", e);
} finally {
client.logout();
}
response.setContentType("text/plain");
PrintWriter out = response.getWriter();
out.print("EJBServlet OK");
out.close();
}
Aggregations