Package org.apache.cocoon.callstack

Examples of org.apache.cocoon.callstack.CallFrame


        protected abstract Enumeration namesOf(HttpServletRequest request);

        public Enumeration getNames() {
            Set names = new HashSet();
            for (int i = 0; i < CallStack.size(); i++) {
                CallFrame frame = CallStack.frameAt(i);
                HttpServletRequest request = (HttpServletRequest) frame.getAttribute(CallFrameHelper.REQUEST_OBJECT);
                if (request instanceof ServletServiceRequest) {
                    names.addAll(this.values.keySet());
                } else {
                    for (Enumeration enumeration = this.namesOf(request); enumeration.hasMoreElements();) {
                        names.add(enumeration.nextElement());
View Full Code Here


        }

        public Map getValues() {
            Map result = new HashMap();
            for (int i = 0; i < CallStack.size(); i++) {
                CallFrame frame = CallStack.frameAt(i);
                HttpServletRequest request = (HttpServletRequest) frame.getAttribute(CallFrameHelper.REQUEST_OBJECT);
                if (request instanceof ServletServiceRequest) {
                    result.putAll(this.values);
                } else {
                    result.putAll(request.getParameterMap());
                }
View Full Code Here

    /** Key for the environment {@link ServletContext} in the call frame. */
    public final static String CONTEXT_OBJECT  = "context";

    public static final void setEnvironment(HttpServletRequest request, HttpServletResponse response, ServletContext context) {
        CallFrame frame = CallStack.getCurrentFrame();
        frame.setAttribute(REQUEST_OBJECT, request);
        frame.setAttribute(RESPONSE_OBJECT, response);
        frame.setAttribute(CONTEXT_OBJECT, context);
    }
View Full Code Here

        frame.setAttribute(RESPONSE_OBJECT, response);
        frame.setAttribute(CONTEXT_OBJECT, context);
    }

    public static final HttpServletRequest getRequest() {
        CallFrame currentCallFrame = CallStack.getCurrentFrame();
       
        if(currentCallFrame == null) {
            return null;
        }
       
        return (HttpServletRequest) currentCallFrame.getAttribute(REQUEST_OBJECT);
    }
View Full Code Here

    public static final void setRequest(HttpServletRequest request) {
        CallStack.getCurrentFrame().setAttribute(REQUEST_OBJECT, request);
    }

    public static final HttpServletResponse getResponse() {
        CallFrame currentCallFrame = CallStack.getCurrentFrame();
       
        if(currentCallFrame == null) {
            return null;
        }
       
        return (HttpServletResponse) currentCallFrame.getAttribute(RESPONSE_OBJECT);
    }
View Full Code Here

    public static final void setResponse(HttpServletResponse response) {
        CallStack.getCurrentFrame().setAttribute(RESPONSE_OBJECT, response);
    }

    public static final ServletContext getContext() {
        CallFrame currentCallFrame = CallStack.getCurrentFrame();
       
        if(currentCallFrame == null) {
            return null;
        }       
       
        return (ServletContext) currentCallFrame.getAttribute(CONTEXT_OBJECT);
    }
View Full Code Here

     *
     * @return a servlet context
     */
    public static ServletContext getBaseServletContext() {
        for (int i = CallStack.size() - 1; i >= 0; i--) {
            CallFrame frame = CallStack.frameAt(i);
            if (frame.hasAttribute(SUPER_CALL) && !((Boolean) frame.getAttribute(SUPER_CALL)).booleanValue()) {
                return (ServletContext) frame.getAttribute(CallFrameHelper.CONTEXT_OBJECT);
            }
        }

        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.callstack.CallFrame

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.