Package org.apache.cocoon.webapps.session

Examples of org.apache.cocoon.webapps.session.ContextManager


    /**
     * Get the context
     */
    private SessionContext getContext(String name)
    throws ProcessingException {
        ContextManager contextManager = null;
        try {
            contextManager = (ContextManager) this.manager.lookup(ContextManager.ROLE);
            return contextManager.getContext( name );
        } catch (ComponentException ce ) {
            throw new ProcessingException("Unable to lookup context manager.", ce);
        } finally {
            this.manager.release( (Component) contextManager);
        }
View Full Code Here


                handler = new UserHandler(config, authContext);
                // store the authentication data in the context
                authContext.init(result.result);
            } else if ( result != null ) {
                // now set the failure information in the temporary context
                ContextManager contextManager = null;
                try {
                    contextManager = (ContextManager) this.manager.lookup( ContextManager.ROLE );
                    SessionContext temp = contextManager.getContext( SessionConstants.TEMPORARY_CONTEXT );
                   
                    final DocumentFragment fragment = result.result.createDocumentFragment();
                    final Node root = result.result.getDocumentElement();
                    root.normalize();
                    Node child;
View Full Code Here

                // we really ignore any exception!
            }
           
            List applicationContexts = handler.getApplicationContexts();
            if ( applicationContexts != null ) {
                ContextManager contextManager = null;

                try {
                    contextManager = (ContextManager)this.manager.lookup(ContextManager.ROLE);

                    Iterator i = applicationContexts.iterator();
                    while ( i.hasNext() ) {
                        final String current = (String)i.next();
                        contextManager.deleteContext( current );
                    }
                } catch (ServiceException ce) {
                    throw new ProcessingException("Unable to create session context.", ce);
                } finally {
                    this.manager.release( contextManager);
View Full Code Here

        UserHandler handler = state.getHandler();
       
        SessionContext context = null;

        if ( handler != null ) {
            ContextManager contextManager = null;
            try {
                contextManager = (ContextManager)this.manager.lookup(ContextManager.ROLE);
                // create new context
                context = contextManager.createContext(name, loadURI, saveURI);
                handler.addApplicationContext( name );

            } catch (ServiceException ce) {
                throw new ProcessingException("Unable to create session context.", ce);
            } catch (IOException ioe) {
View Full Code Here

                handler = new UserHandler(config, authContext);
                // store the authentication data in the context
                authContext.init(result.result);
            } else if ( result != null ) {
                // now set the failure information in the temporary context
                ContextManager contextManager = null;
                try {
                    contextManager = (ContextManager) this.manager.lookup( ContextManager.ROLE );
                    SessionContext temp = contextManager.getContext( SessionConstants.TEMPORARY_CONTEXT );
                   
                    final DocumentFragment fragment = result.result.createDocumentFragment();
                    final Node root = result.result.getDocumentElement();
                    root.normalize();
                    Node child;
View Full Code Here

                // we really ignore any exception!
            }
           
            List applicationContexts = handler.getApplicationContexts();
            if ( applicationContexts != null ) {
                ContextManager contextManager = null;

                try {
                    contextManager = (ContextManager)this.manager.lookup(ContextManager.ROLE);

                    Iterator i = applicationContexts.iterator();
                    while ( i.hasNext() ) {
                        final String current = (String)i.next();
                        contextManager.deleteContext( current );
                    }
                } catch (ServiceException ce) {
                    throw new ProcessingException("Unable to create session context.", ce);
                } finally {
                    this.manager.release( contextManager);
View Full Code Here

        UserHandler handler = state.getHandler();
       
        SessionContext context = null;

        if ( handler != null ) {
            ContextManager contextManager = null;
            try {
                contextManager = (ContextManager)this.manager.lookup(ContextManager.ROLE);
                // create new context
                context = contextManager.createContext(name, loadURI, saveURI);
                handler.addApplicationContext( name );

            } catch (ServiceException ce) {
                throw new ProcessingException("Unable to create session context.", ce);
            } catch (IOException ioe) {
View Full Code Here

    /**
     * Get the context
     */
    private SessionContext getContext(String name)
    throws ProcessingException {
        ContextManager contextManager = null;
        try {
            contextManager = (ContextManager) this.manager.lookup(ContextManager.ROLE);
            return contextManager.getContext( name );
        } catch (ServiceException ce ) {
            throw new ProcessingException("Unable to lookup context manager.", ce);
        } finally {
            this.manager.release(contextManager);
        }
View Full Code Here

            } else {
                authenticationFragment.appendChild(doc.importNode(data, true));
            }
           
            // now set this information in the temporary context
            ContextManager sessionManager = null;
            try {
                sessionManager = (ContextManager) this.manager.lookup( ContextManager.ROLE );
                SessionContext temp = sessionManager.getContext( SessionConstants.TEMPORARY_CONTEXT );
                temp.appendXML("/", authenticationFragment);
            } catch ( ServiceException se ) {
                throw new ProcessingException("Unable to lookup session manager.", se);
            } finally {
                this.manager.release( (Component)sessionManager );
View Full Code Here

            } else {
                authenticationFragment.appendChild(doc.importNode(data, true));
            }
           
            // now set this information in the temporary context
            ContextManager sessionManager = null;
            try {
                sessionManager = (ContextManager) this.manager.lookup( ContextManager.ROLE );
                SessionContext temp = sessionManager.getContext( SessionConstants.TEMPORARY_CONTEXT );
                temp.appendXML("/", authenticationFragment);
            } catch ( ServiceException se ) {
                throw new ProcessingException("Unable to lookup session manager.", se);
            } finally {
                this.manager.release( (Component)sessionManager );
View Full Code Here

TOP

Related Classes of org.apache.cocoon.webapps.session.ContextManager

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.