Package org.apache.geronimo.security

Examples of org.apache.geronimo.security.Callers


     */
    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


    public DefaultSubjectValve(Subject defaultSubject) {
        this.defaultSubject = defaultSubject;
    }

    public void invoke(Request request, Response response) throws IOException, ServletException {
        Callers oldCallers = null;
        boolean setSubject = false;
        if (defaultSubject != null) {
            oldCallers = ContextManager.getCallers();
            setSubject = oldCallers == null || oldCallers.getCurrentCaller() == null;
        }
        if (setSubject) {
            ContextManager.setCallers(defaultSubject, defaultSubject);
            try {
                getNext().invoke(request, response);
View Full Code Here

                            HttpServletResponse response,
                            ServletHolder servletHolder,
                            int type)
        throws ServletException, UnavailableException, IOException
    {
        Callers oldCallers = ContextManager.getCallers();
        try {
            super.dispatch(pathInContext, request, response, servletHolder, type);
        } finally {
            ContextManager.popCallers(oldCallers);
        }
View Full Code Here

        setCurrentServletName(getServletName());
        if (runAsSubject == null) {
            super.handle(request, response);
        } else {
            Callers oldCallers = ContextManager.pushNextCaller(runAsSubject);
            try {
                super.handle(request, response);
            } finally {
                ContextManager.popCallers(oldCallers);
            }
View Full Code Here

        Thread thread = Thread.currentThread();

        ClassLoader oldClassLoader = thread.getContextClassLoader();
        TransactionContext oldTransactionContext = transactionContextManager.getContext();
        TransactionContext currentTransactionContext = null;
        Callers oldCallers = ContextManager.getCallers();
        Subject clientSubject = defaultSubject;
        LoginContext loginContext = null;
        try {
            thread.setContextClassLoader(classLoader);
            if (callbackHandlerClass != null) {
View Full Code Here

        setCurrentServletName(getName());
        try {
            if (runAsSubject == null) {
                super.handle(request, response);
            } else {
                Callers oldCallers = ContextManager.pushNextCaller(runAsSubject);
                try {
                    super.handle(request, response);
                } finally {
                    ContextManager.popCallers(oldCallers);
                }
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

    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

                Stack<Callers> callersStack = threadLocal.get();
                GeronimoStandardContext context = (GeronimoStandardContext) parent;
                Wrapper wrapper = event.getWrapper();
                String runAsRole = wrapper.getRunAs();
                Subject runAsSubject = context.getSubjectForRole(runAsRole);
                Callers oldCallers = ContextManager.pushNextCaller(runAsSubject);
                callersStack.push(oldCallers);
            }
        } else if (event.getType().equals(InstanceEvent.AFTER_SERVICE_EVENT)) {
            Container parent = event.getWrapper().getParent();
            if (parent instanceof GeronimoStandardContext) {
                Stack<Callers> callersStack = threadLocal.get();
                Callers oldCallers = callersStack.pop();
                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.