org.apache.wicket.page
Class PageAccessSynchronizer

java.lang.Object
  extended by org.apache.wicket.page.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

Nested Class Summary
static class PageAccessSynchronizer.PageLock
          Thread's lock on a page
 
Constructor Summary
PageAccessSynchronizer(Duration timeout)
          Constructor
 
Method Summary
 IPageManager adapt(IPageManager pagemanager)
          Wraps a page manager with this synchronizer
 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(Duration timeout)
Constructor

Parameters:
timeout - timeout value for acquiring a page lock
Method Detail

lockPage

public void lockPage(int pageId)
              throws CouldNotLockPageException
Acquire a lock to a page

Parameters:
pageId - page id
Throws:
CouldNotLockPageException - if lock could not be acquired

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 pagemanager)
Wraps a page manager with this synchronizer

Parameters:
pagemanager -
Returns:
wrapped page manager


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.