Package org.apache.wicket

Examples of org.apache.wicket.AccessStackPageMap


            // request
            processRequest = false;
          }
          else if (pageMap instanceof AccessStackPageMap)
          {
            AccessStackPageMap accessStackPageMap = (AccessStackPageMap)pageMap;
            if (accessStackPageMap.getAccessStack().size() > 0)
            {
              final Access access = accessStackPageMap.getAccessStack().peek();

              final int pageId = Integer.parseInt(Strings.firstPathComponent(
                requestParameters.getComponentPath(), Component.PATH_SEPARATOR));

              if (pageId != access.getId())
View Full Code Here


  {
    if (pageMap instanceof AccessStackPageMap)
    {
      synchronized (Session.get())
      {
        AccessStackPageMap accessPM = (AccessStackPageMap)pageMap;
        // Do we need to evict under this strategy?
        if (accessPM.getVersions() > maxVersions)
        {
          // Remove oldest entry from access stack
          final AccessStackPageMap.Access oldestAccess = accessPM.getAccessStack()
            .remove(0);
          final IPageMapEntry oldestEntry = pageMap.getEntry(oldestAccess.getId());

          // If entry is a page (cannot be null if we're evicting)
          if (oldestEntry instanceof Page)
          {
            Page page = (Page)oldestEntry;

            // If there is more than one version of this page
            if (page.getVersions() > 1)
            {
              // expire the oldest version
              page.expireOldestVersion();
            }
            else
            {
              // expire whole page
              accessPM.removeEntry(page);
            }
          }
          else
          {
            // If oldestEntry is not an instance of Page, then it is
            // some
            // custom, user-defined IPageMapEntry class and cannot
            // contain
            // versioning information, so we just remove the entry.
            if (oldestEntry != null)
            {
              accessPM.removeEntry(oldestEntry);
            }
          }
        }
      }
    }
View Full Code Here

              // request
              processRequest = 1;
            }
            else if (pageMap instanceof AccessStackPageMap)
            {
              AccessStackPageMap accessStackPageMap = (AccessStackPageMap)pageMap;
              if (accessStackPageMap.getAccessStack().size() > 0)
              {
                final Access access = accessStackPageMap.getAccessStack().peek();

                final int pageId = Integer.parseInt(Strings.firstPathComponent(
                  requestParameters.getComponentPath(), Component.PATH_SEPARATOR));

                if (pageId != access.getId())
View Full Code Here

  /**
   * @see org.apache.wicket.session.ISessionStore#createPageMap(java.lang.String)
   */
  public IPageMap createPageMap(String name)
  {
    return new AccessStackPageMap(name);
  }
View Full Code Here

  {
    if (pageMap instanceof AccessStackPageMap)
    {
      synchronized (Session.get())
      {
        AccessStackPageMap accessPM = (AccessStackPageMap)pageMap;
        // Do we need to evict under this strategy?
        if (accessPM.getVersions() > maxVersions)
        {
          // Remove oldest entry from access stack
          final AccessStackPageMap.Access oldestAccess = (Access)accessPM
              .getAccessStack().remove(0);
          final IPageMapEntry oldestEntry = pageMap.getEntry(oldestAccess.getId());

          // If entry is a page (cannot be null if we're evicting)
          if (oldestEntry instanceof Page)
          {
            Page page = (Page)oldestEntry;

            // If there is more than one version of this page
            if (page.getVersions() > 1)
            {
              // expire the oldest version
              page.expireOldestVersion();
            }
            else
            {
              // expire whole page
              accessPM.removeEntry(page);
            }
          }
          else
          {
            // If oldestEntry is not an instance of Page, then it is
            // some
            // custom, user-defined IPageMapEntry class and cannot
            // contain
            // versioning information, so we just remove the entry.
            if (oldestEntry != null)
            {
              accessPM.removeEntry(oldestEntry);
            }
          }
        }
      }
    }
View Full Code Here

            // request
            processRequest = false;
          }
          else if (pageMap instanceof AccessStackPageMap)
          {
            AccessStackPageMap accessStackPageMap = (AccessStackPageMap)pageMap;
            if (accessStackPageMap.getAccessStack().size() > 0)
            {
              final Access access = (Access)accessStackPageMap.getAccessStack()
                  .peek();

              final int pageId = Integer
                  .parseInt(Strings.firstPathComponent(requestParameters
                      .getComponentPath(), Component.PATH_SEPARATOR));
View Full Code Here

  /**
   * @see org.apache.wicket.session.ISessionStore#createPageMap(java.lang.String)
   */
  public IPageMap createPageMap(String name)
  {
    return new AccessStackPageMap(name);
  }
View Full Code Here

  {
    if (pageMap instanceof AccessStackPageMap)
    {
      synchronized (Session.get())
      {
        AccessStackPageMap accessPM = (AccessStackPageMap)pageMap;
        // Do we need to evict under this strategy?
        if (accessPM.getVersions() > maxVersions)
        {
          // Remove oldest entry from access stack
          final AccessStackPageMap.Access oldestAccess = (Access)accessPM.getAccessStack()
            .remove(0);
          final IPageMapEntry oldestEntry = pageMap.getEntry(oldestAccess.getId());

          // If entry is a page (cannot be null if we're evicting)
          if (oldestEntry instanceof Page)
          {
            Page<?> page = (Page<?>)oldestEntry;

            // If there is more than one version of this page
            if (page.getVersions() > 1)
            {
              // expire the oldest version
              page.expireOldestVersion();
            }
            else
            {
              // expire whole page
              accessPM.removeEntry(page);
            }
          }
          else
          {
            // If oldestEntry is not an instance of Page, then it is
            // some
            // custom, user-defined IPageMapEntry class and cannot
            // contain
            // versioning information, so we just remove the entry.
            if (oldestEntry != null)
            {
              accessPM.removeEntry(oldestEntry);
            }
          }
        }
      }
    }
View Full Code Here

            // request
            processRequest = false;
          }
          else if (pageMap instanceof AccessStackPageMap)
          {
            AccessStackPageMap accessStackPageMap = (AccessStackPageMap)pageMap;
            if (accessStackPageMap.getAccessStack().size() > 0)
            {
              final Access access = (Access)accessStackPageMap.getAccessStack()
                  .peek();

              final int pageId = Integer
                  .parseInt(Strings.firstPathComponent(requestParameters
                      .getComponentPath(), Component.PATH_SEPARATOR));
View Full Code Here

  /**
   * @see org.apache.wicket.session.ISessionStore#createPageMap(java.lang.String)
   */
  public IPageMap createPageMap(String name)
  {
    return new AccessStackPageMap(name);
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.AccessStackPageMap

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.