Package org.apache.geronimo.tomcat

Examples of org.apache.geronimo.tomcat.GeronimoStandardContext


    public void lifecycleEvent(LifecycleEvent lifecycleEvent) {
        String lifecycleEventType = lifecycleEvent.getType();
        if (lifecycleEventType.equals(Lifecycle.BEFORE_START_EVENT)) {
            //Initialize SpecSecurityBuilder
            SpecSecurityBuilder specSecurityBuilder = new SpecSecurityBuilder(bundle, deploymentDescriptor, annotationScanRequired);
            GeronimoStandardContext standardContext = (GeronimoStandardContext) lifecycleEvent.getSource();
            GeronimoApplicationContext applicationContext = (GeronimoApplicationContext) standardContext.getInternalServletContext();
            applicationContext.setSpecSecurityBuilder(specSecurityBuilder);
        } else if (lifecycleEventType.equals(Lifecycle.START_EVENT)) {
            GeronimoStandardContext standardContext = (GeronimoStandardContext) lifecycleEvent.getSource();
            GeronimoApplicationContext applicationContext = (GeronimoApplicationContext) standardContext.getInternalServletContext();
            //Calculate the final Security Permissions
            SpecSecurityBuilder specSecurityBuilder = applicationContext.getSpecSecurityBuilder();
            Map<String, ComponentPermissions> contextIdPermissionsMap = new HashMap<String, ComponentPermissions>();
            contextIdPermissionsMap.put(contextId, specSecurityBuilder.buildSpecSecurityConfig());
            //Update ApplicationPolicyConfigurationManager
View Full Code Here


        if (event.getType().equals(InstanceEvent.BEFORE_SERVICE_EVENT)) {
            Container parent = event.getWrapper().getParent();
            if (parent instanceof GeronimoStandardContext) {
                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();
View Full Code Here

    public void instanceEvent(InstanceEvent event) {
       
        if (event.getType().equals(InstanceEvent.BEFORE_SERVICE_EVENT)) {
            Container parent = event.getWrapper().getParent();
            if (parent instanceof GeronimoStandardContext) {
                GeronimoStandardContext context = (GeronimoStandardContext)parent;
                Wrapper wrapper = event.getWrapper();
                String runAsRole = wrapper.getRunAs();
                Subject runAsSubject = context.getSubjectForRole(runAsRole);
                List<Callers> callersStack = threadLocal.get();
                if (runAsSubject != null) {
                    Callers oldCallers = ContextManager.pushNextCaller(runAsSubject);
                    callersStack.add(oldCallers);
                } else {
View Full Code Here

    public void instanceEvent(InstanceEvent event) {
       
        if (event.getType().equals(InstanceEvent.BEFORE_SERVICE_EVENT)) {
            Container parent = event.getWrapper().getParent();
            if (parent instanceof GeronimoStandardContext) {
                GeronimoStandardContext context = (GeronimoStandardContext)parent;
                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);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.tomcat.GeronimoStandardContext

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.