public void ensureFailover( HttpServletRequest request )
    {
        //
        // remove() puts the pageflow instance into a request attribute.  Make sure not to re-save this
        // 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, and ensure that
            // both failover correctly.
            //
            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() );
            }
            //
            // This Page Flow is not long lived, so just the Page Flow itself needs to be added to the session.
            //
            else
            {
                String attrName = ScopedServletUtils.getScopedSessionAttrName( CURRENT_JPF_ATTR, unwrappedRequest );
                sh.ensureFailover( rc, attrName, this );
            }
        }
    }
public void ensureFailover ( HttpServletRequest request ) { 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 ( 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 ) ; } } }
<p>
Ensure that any changes to this object will be replicated in a cluster (for failover), even if the
replication scheme uses a change-detection algorithm that relies on
{@link javax.servlet.http.HttpSession#setAttribute(String, Object)} to be aware of changes.  This method is
used by the framework and should not be called directly in most cases.
</p>
<p>
Note, this method ultimately causes the Page Flow to be persisted in the {@link StorageHandler} for this web application.
</p>

@param request the current {@link HttpServletRequest}