Examples of SecurityClient


Examples of org.jboss.security.client.SecurityClient

    @EJB(lookup = "java:global/ejb3-servlet-ejbs/StatelessBean!org.jboss.as.test.integration.ejb.servlet.StatelessLocal")
    StatelessLocal injectedStateless;

    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:global/ejb3-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();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.