Package org.apache.geronimo.security

Examples of org.apache.geronimo.security.Callers


    public void init() {
        System.out.println("Test Servlet init");
    }

    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Callers callers = ContextManager.getCallers();
        Subject current = callers.getCurrentCaller();
        Subject next = callers.getNextCaller();
        PrintWriter out = response.getWriter();
        out.println("Current subject: " + current);
        out.println("Next subject:    " + next);
        //this should create the database
        if (csds == null) {
View Full Code Here


        //TODO reorganize this so it makes more sense.  maybe use an interceptor stack.
        //TODO track resource ref shared and app managed security
        Thread thread = Thread.currentThread();

        ClassLoader oldClassLoader = thread.getContextClassLoader();
        Callers oldCallers = ContextManager.getCallers();
        Subject clientSubject = defaultSubject;
        try {
            thread.setContextClassLoader(classLoader);
            jndiContext.startClient(appClientModuleName, kernel, classLoader);
            Context componentContext = jndiContext.getJndiContext();
View Full Code Here

     */
    public void handle(String target, HttpServletRequest request,
            HttpServletResponse response, int dispatch) throws IOException,
            ServletException {
        String old_policy_id = PolicyContext.getContextID();
        Callers oldCallers = ContextManager.getCallers();

        try {
            PolicyContext.setContextID(policyContextID);
            PolicyContext.setHandlerData(request);

View Full Code Here

                Servlet servlet = event.getServlet();
                ServletConfig config = servlet.getServletConfig();
                String servletName = config.getServletName();
                Subject runAsSubject = context.getRoleDesignate(servletName);
                if (runAsSubject != null) {
                    Callers oldCallers = ContextManager.getCallers();
                    ContextManager.registerSubject(runAsSubject);
                    ContextManager.pushNextCaller(runAsSubject);
                    threadLocal.set(oldCallers);
                }
            }
        }

        else if (event.getType().equals(InstanceEvent.AFTER_SERVICE_EVENT)) {
            Callers oldCallers = threadLocal.get();
            if (oldCallers!=null) {
                ContextManager.popCallers(oldCallers);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.security.Callers

Copyright © 2018 www.massapicom. 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.