Examples of StorageHandler


Examples of org.apache.beehive.netui.pageflow.handler.StorageHandler

     * Store this object in the user session, in the appropriate place.  Used by the framework; normally should not be
     * called directly.
     */
    public void persistInSession( HttpServletRequest request, HttpServletResponse response )
    {
        StorageHandler sh = Handlers.get( getServletContext() ).getStorageHandler();
        HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
        String attrName = ScopedServletUtils.getScopedSessionAttrName(InternalConstants.SHARED_FLOW_ATTR_PREFIX
                                                                      + getClass().getName(), unwrappedRequest);
        sh.setAttribute( rc, attrName, this );
    }
View Full Code Here

Examples of org.apache.beehive.netui.pageflow.handler.StorageHandler

     *
     * @param request the current HttpServletRequest
     */
    public void ensureFailover( HttpServletRequest request )
    {
        StorageHandler sh = Handlers.get( getServletContext() ).getStorageHandler();
        HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
        String attrName = ScopedServletUtils.getScopedSessionAttrName(InternalConstants.SHARED_FLOW_ATTR_PREFIX
                                                                      + getClass().getName(), request);
        sh.ensureFailover( rc, attrName, this );
    }
View Full Code Here

Examples of org.apache.beehive.netui.pageflow.handler.StorageHandler

     * @param servletContext the current ServletContext.
     * @return a {@link PageFlowStack} of nested page flows ({@link PageFlowController}s) for the current user session.
     */   
    public static PageFlowStack get( HttpServletRequest request, ServletContext servletContext, boolean createIfNotExist )
    {
        StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
        HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
        String attrName = ScopedServletUtils.getScopedSessionAttrName( JPF_STACK_ATTR, unwrappedRequest );
        PageFlowStack jpfStack = ( PageFlowStack ) sh.getAttribute( rc, attrName );
       
        if ( jpfStack == null && createIfNotExist )
        {
            jpfStack = new PageFlowStack( servletContext );
            jpfStack.save( request );
View Full Code Here

Examples of org.apache.beehive.netui.pageflow.handler.StorageHandler

     *
     * @param request the current HttpServletRequest.
     */
    public void destroy( HttpServletRequest request )
    {
        StorageHandler sh = Handlers.get( getServletContext() ).getStorageHandler();
        HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
        String attrName = ScopedServletUtils.getScopedSessionAttrName( JPF_STACK_ATTR, unwrappedRequest );
       
        sh.removeAttribute( rc, attrName );
    }
View Full Code Here

Examples of org.apache.beehive.netui.pageflow.handler.StorageHandler

        return -1;
    }
   
    void ensureFailover( HttpServletRequest request, ServletContext servletContext )
    {
        StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
        HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
        String attrName = ScopedServletUtils.getScopedSessionAttrName( JPF_STACK_ATTR, unwrappedRequest );
       
        sh.ensureFailover( rc, attrName, this );
    }
View Full Code Here

Examples of org.apache.beehive.netui.pageflow.handler.StorageHandler

        sh.ensureFailover( rc, attrName, this );
    }
   
    void save( HttpServletRequest request )
    {
        StorageHandler sh = Handlers.get( getServletContext() ).getStorageHandler();
        HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
        String attrName = ScopedServletUtils.getScopedSessionAttrName( JPF_STACK_ATTR, unwrappedRequest );
       
        sh.setAttribute( rc, attrName, this );
    }
View Full Code Here

Examples of org.apache.beehive.netui.pageflow.handler.StorageHandler

        // instance if it's being removed.  Also, if the session is null (after having been invalidated
        // by the user), don't recreate it.
        //
        if ( request.getAttribute( REMOVING_PAGEFLOW_ATTR ) != this && request.getSession( false ) != null )
        {
            StorageHandler sh = Handlers.get( getServletContext() ).getStorageHandler();
            HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
            RequestContext rc = new RequestContext( unwrappedRequest, null );

            //
            // If this is a long-lived page flow, there are two attributes to deal with.
            //
            if ( isLongLived() )
            {
                String longLivedAttrName = InternalUtils.getLongLivedFlowAttr( getModulePath() );
                longLivedAttrName = ScopedServletUtils.getScopedSessionAttrName( longLivedAttrName, unwrappedRequest );
                String currentLongLivedAttrName =
                    ScopedServletUtils.getScopedSessionAttrName( CURRENT_LONGLIVED_ATTR, unwrappedRequest );
                sh.ensureFailover( rc, longLivedAttrName, this );
                sh.ensureFailover( rc, currentLongLivedAttrName, getModulePath() );
            }
            else
            {
                String attrName = ScopedServletUtils.getScopedSessionAttrName( CURRENT_JPF_ATTR, unwrappedRequest );
                sh.ensureFailover( rc, attrName, this );
            }
        }
    }
View Full Code Here

Examples of org.apache.beehive.netui.pageflow.handler.StorageHandler

     * @param name The name of the value to be retrieved
     * @return The requested value from the session
     */
    private static Object getSessionVar(HttpServletRequest request, ServletContext servletContext, String name)
    {
        StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();

        HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
        String attrName = ScopedServletUtils.getScopedSessionAttrName(name, unwrappedRequest);
        return sh.getAttribute( rc, attrName );
    }
View Full Code Here

Examples of org.apache.beehive.netui.pageflow.handler.StorageHandler

     * @param name The name of the variable to be stored
     * @param value The value of the variable to be stored
     */
    private static void setSessionVar(HttpServletRequest request, ServletContext servletContext, String name, Object value)
    {
        StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();

        HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
        String attrName = ScopedServletUtils.getScopedSessionAttrName(name, unwrappedRequest);
        sh.setAttribute( rc, attrName, value );
    }
View Full Code Here

Examples of org.apache.beehive.netui.pageflow.handler.StorageHandler

        setCurrentActionResolver( jpf, request, servletContext );
    }

    public static void removeCurrentPageFlow( HttpServletRequest request, ServletContext servletContext )
    {
        StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
        HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
        String currentJpfAttrName = ScopedServletUtils.getScopedSessionAttrName( CURRENT_JPF_ATTR, unwrappedRequest );
        String currentLongLivedAttrName =
                ScopedServletUtils.getScopedSessionAttrName( CURRENT_LONGLIVED_ATTR, unwrappedRequest );

        sh.removeAttribute( rc, currentJpfAttrName );
        sh.removeAttribute( rc, currentLongLivedAttrName );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.