Package org.apache.wicket.page
Class PageAccessSynchronizer
- java.lang.Object
-
- org.apache.wicket.page.PageAccessSynchronizer
-
- All Implemented Interfaces:
Serializable
public class PageAccessSynchronizer extends Object implements Serializable
Synchronizes access to page instances from multiple threads- Author:
- Igor Vaynberg (ivaynberg)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PageAccessSynchronizer.PageLock
Thread's lock on a page
-
Constructor Summary
Constructors Constructor Description PageAccessSynchronizer(Duration timeout)
ConstructorPageAccessSynchronizer(IPageLockManager pageLockManager)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IPageManager
adapt(IPageManager manager)
Wraps a page manager with this synchronizervoid
lockPage(int pageId)
Acquire a lock to a pagevoid
unlockAllPages()
Unlocks all pages locked by this threadvoid
unlockPage(int pageId)
Unlocks a single page locked by the current thread.
-
-
-
Constructor Detail
-
PageAccessSynchronizer
public PageAccessSynchronizer(Duration timeout)
Constructor- Parameters:
timeout
- timeout value for acquiring a page lock
-
PageAccessSynchronizer
public PageAccessSynchronizer(IPageLockManager pageLockManager)
Constructor- Parameters:
pageLockManager
- the lock manager
-
-
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 manager)
Wraps a page manager with this synchronizer- Parameters:
manager
-- Returns:
- wrapped page manager
-
-