Class PageAccessSynchronizer

  • All Implemented Interfaces:
    java.io.Serializable

    public class PageAccessSynchronizer
    extends java.lang.Object
    implements java.io.Serializable
    Synchronizes access to page instances from multiple threads
    Author:
    Igor Vaynberg (ivaynberg)
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      PageAccessSynchronizer​(org.apache.wicket.util.time.Duration timeout)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IPageManager adapt​(IPageManager manager)
      Wraps a page manager with this synchronizer
      org.apache.wicket.util.time.Duration getTimeout​(int pageId)  
      void lockPage​(int pageId)
      Acquire a lock to a page
      void unlockAllPages()
      Unlocks all pages locked by this thread
      void unlockPage​(int pageId)
      Unlocks a single page locked by the current thread.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PageAccessSynchronizer

        public PageAccessSynchronizer​(org.apache.wicket.util.time.Duration timeout)
        Constructor
        Parameters:
        timeout - timeout value for acquiring a page lock
    • Method Detail

      • getTimeout

        public org.apache.wicket.util.time.Duration getTimeout​(int pageId)
        Parameters:
        pageId - the id of the page to be locked
        Returns:
        the duration for acquiring a page lock
      • unlockAllPages

        public void unlockAllPages()
        Unlocks all pages locked by this thread
      • unlockPage

        public void unlockPage​(int pageId)
        Unlocks a single page locked by the current thread.
        Parameters:
        pageId - the id of the page which should be unlocked.
      • adapt

        public IPageManager adapt​(IPageManager manager)
        Wraps a page manager with this synchronizer
        Parameters:
        manager -
        Returns:
        wrapped page manager