Package org.apache.cocoon.environment

Examples of org.apache.cocoon.environment.Session


        if (SCOPE_REQUEST.equals(scope)) {
            request.setAttribute(id_, this);
        } else // session scope
        {
            Session session = request.getSession(true);

            session.setAttribute(id_, this);
        }

    }
View Full Code Here


    /**
     * Get the list of contexts
     */
    protected Map getSessionContexts() {
        if (this.contexts == null) {
            Session session = this.getSession(true);
            this.contexts = (Map)session.getAttribute("org.apache.cocoon.webapps.session.context.SessionContext");
            if (this.contexts == null) {
                this.contexts = new HashMap(5, 3);
                session.setAttribute("org.apache.cocoon.webapps.session.context.SessionContext", this.contexts);
            }
        }
        return this.contexts;
    }
View Full Code Here

    /**
     * Get the list of contexts
     */
    protected Map getSessionContextsTransactionStates() {
        if (this.transactionStates == null) {
            Session session = this.getSession(true);
            this.transactionStates = (Map)session.getAttribute("org.apache.cocoon.webapps.session.context.TransactionState");
            if (this.transactionStates == null) {
                this.transactionStates = new HashMap(5, 3);
                session.setAttribute("org.apache.cocoon.webapps.session.context.TransactionState", this.transactionStates);
            }
        }
        return this.transactionStates;
    }
View Full Code Here

    public Session createSession() {
        // synchronized
        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN createSession");
        }
        Session session = this.getSession(true);

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END createSession session=" + session);
        }
        return session;
View Full Code Here

    public Session getSession(boolean createFlag) {
        // synchronized
        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN getSession create=" + createFlag);
        }
        Session session = this.request.getSession(createFlag);

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END getSession session=" + session);
        }
View Full Code Here

        // synchronized
        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN terminateSession force="+force);
        }

        Session session = request.getSession(false);
        if (session != null) {
            if (force == true
                || this.hasSessionContext() == false) {
                synchronized(session) {
                    session.invalidate();
                }
            }
        }
        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END terminateSession");
View Full Code Here

            this.getLogger().debug("BEGIN createContext name=" + name +
                                   "load=" + loadURI +
                                   "save=" + saveURI);
        }
        // test arguments
        Session session = this.getSession(false);
        if (session == null) {
            throw new ProcessingException("CreateContext: Session is required");
        }
        if (name == null) {
            throw new ProcessingException("CreateContext: Name is required");
View Full Code Here

            throw new ProcessingException("SessionManager.deleteContext: Name is required");
        }
        if (SessionManager.isReservedContextName(name) == true) {
            throw new ProcessingException("SessionContext with name " + name + " is reserved and cannot be deleted manually.");
        }
        Session session = this.getSession(false);
        if (session == null) {
            throw new ProcessingException("SessionManager.deleteContext: Session is required");
        }

        synchronized(session) {
View Full Code Here

        SessionContext context;
        if (SessionManager.isReservedContextName(contextName) == true) {
            context = this.getReservedContext(contextName);
        } else {
            Session session = this.getSession(false);
            if (session == null) {
                throw new ProcessingException("SessionManager.getContextFragment: Session is required for context " + contextName);
            }
            context = this.getContext(contextName);
        }
View Full Code Here

        DocumentFragment value = null;
        SessionContext context = this.getContext(contextName);
        if (context == null) {
            throw new ProcessingException("SessionManager.registerInputField: Context not found " + contextName);
        }
        Session session = this.getSession(false);
        if (session == null) {
            throw new ProcessingException("SessionManager.registerInputField: Session is required for context " + contextName);
        }

        synchronized(session) {
            Map inputFields = (Map)session.getAttribute(SessionManager.ATTRIBUTE_INPUTXML_STORAGE);
            if (inputFields == null) {
                inputFields = new HashMap(10);
                session.setAttribute(SessionManager.ATTRIBUTE_INPUTXML_STORAGE, inputFields);
            }
            inputFields.put(name, new Object[] {context, path, formName});
            value = context.getXML(path);
        }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.environment.Session

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.