Examples of StorageHandler


Examples of com.kellerkindt.scs.interfaces.StorageHandler

            return true;
       
        //Purge command will empty the mini file, and then replace with whatever is loaded.
        //
        ShopHandler     sh       = scs.getShopHandler();
        StorageHandler    storage    = scs.getStorageHandler();
       
        try {
                Messaging.send(cs, Term.PRUNE.get());
                ShowCaseStandalone.slog(Level.INFO, "Backup.");
                List<Shop>  shops  = new ArrayList<Shop>();
                for (Shop p : sh)
                  shops.add(p);
               
                ShowCaseStandalone.slog(Level.INFO, "Remove all shops from storage.");
                sh.removeAll();
               
                ShowCaseStandalone.slog(Level.INFO, "Add backuped shops.");
                sh.addAll(shops);

                ShowCaseStandalone.slog(Level.INFO, "Saving all currently loaded shops.");
                storage.save(sh);
               
      } catch (Exception ioe) {
        ShowCaseStandalone.slog(Level.WARNING, "Exception on prune: " + ioe.getLocalizedMessage());
                Messaging.send(cs, Term.ERROR_GENERAL.get("pruning") + ioe.getLocalizedMessage());//msg: generalError %1 (reloading)
      }
View Full Code Here

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 );
        sh.setAttribute( rc, InternalConstants.SHARED_FLOW_ATTR_PREFIX + getClass().getName(), 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 );
        sh.ensureFailover( rc, InternalConstants.SHARED_FLOW_ATTR_PREFIX + getClass().getName(), this );
    }
View Full Code Here

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

     * @param servletContext the current ServletContext.
     * @return the current ActionResolver from the user session, or <code>null</code> if there is none.
     */
    public static ActionResolver getCurrentActionResolver( HttpServletRequest request, ServletContext servletContext )
    {
        StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
        HttpServletRequest unwrappedRequest = unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
       
        //
        // First see if the current page flow is a long-lived, which is stored in its own attribute.
        //
        String currentLongLivedAttrName =
                ScopedServletUtils.getScopedSessionAttrName( CURRENT_LONGLIVED_ATTR, unwrappedRequest );
        String currentLongLivedModulePath = ( String ) sh.getAttribute( rc, currentLongLivedAttrName );
        ActionResolver retVal;
       
        if ( currentLongLivedModulePath != null )
        {
            return getLongLivedPageFlow( currentLongLivedModulePath, unwrappedRequest );
        }
        else
        {
            String currentJpfAttrName = ScopedServletUtils.getScopedSessionAttrName( CURRENT_JPF_ATTR, unwrappedRequest );
            return ( ActionResolver ) sh.getAttribute( rc, currentJpfAttrName );
        }
    }
View Full Code Here

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

     * @return the {@link SharedFlowController} of the given class name which is stored in the user session.
     */
    public static SharedFlowController getSharedFlow( String sharedFlowClassName, HttpServletRequest request,
                                                      ServletContext servletContext )
    {
        StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
        HttpServletRequest unwrappedRequest = unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
       
        return ( SharedFlowController ) sh.getAttribute( rc, SHARED_FLOW_ATTR_PREFIX + sharedFlowClassName );
    }
View Full Code Here

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

     * @param request the current HttpServletRequest.
     */
    public static void removeSharedFlow( String sharedFlowClassName, HttpServletRequest request,
                                         ServletContext servletContext )
    {
        StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
        HttpServletRequest unwrappedRequest = unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
        sh.removeAttribute( rc, SHARED_FLOW_ATTR_PREFIX + sharedFlowClassName );
    }
View Full Code Here

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

     * remove it.
     */
    public static void removeLongLivedPageFlow( String modulePath, HttpServletRequest request,
                                                ServletContext servletContext )
    {
        StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
        HttpServletRequest unwrappedRequest = unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
       
        String attrName = InternalUtils.getLongLivedFlowAttr( modulePath );
        attrName = ScopedServletUtils.getScopedSessionAttrName( attrName, unwrappedRequest );
        sh.removeAttribute( rc, attrName );

        //
        // Now, if the current page flow is long-lived, remove the reference.
        //
        String currentLongLivedAttrName =
                ScopedServletUtils.getScopedSessionAttrName( CURRENT_LONGLIVED_ATTR, unwrappedRequest );
        String currentLongLivedModulePath =
                ( String ) sh.getAttribute( rc, currentLongLivedAttrName );
       
        if ( modulePath.equals( currentLongLivedModulePath ) )
        {
            sh.removeAttribute( rc, currentLongLivedAttrName );
        }
    }
View Full Code Here

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

     * @return the long-lived page flow instance associated with the given module, or <code>null</code> if none is found.
     */
    public static PageFlowController getLongLivedPageFlow( String modulePath, HttpServletRequest request,
                                                           ServletContext servletContext )
    {
        StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
        HttpServletRequest unwrappedRequest = unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
       
        String attrName = InternalUtils.getLongLivedFlowAttr( modulePath );
        attrName = ScopedServletUtils.getScopedSessionAttrName( attrName, unwrappedRequest );
        PageFlowController retVal =  ( PageFlowController ) sh.getAttribute( rc, attrName );
        return retVal;
    }
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

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

        sh.removeAttribute( rc, currentLongLivedAttrName );
    }

    public static void removeCurrentFacesBackingBean( 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( FACES_BACKING_ATTR, unwrappedRequest );

        sh.removeAttribute( rc, attrName );
    }
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.