Package org.apache.wicket.page
Class PageAccessSynchronizer
- java.lang.Object
-
- org.apache.wicket.page.PageAccessSynchronizer
-
- All Implemented Interfaces:
java.io.Serializable
public class PageAccessSynchronizer extends java.lang.Object implements java.io.SerializableSynchronizes 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 classPageAccessSynchronizer.PageLockThread's lock on a page
-
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 IPageManageradapt(IPageManager manager)Wraps a page manager with this synchronizerorg.apache.wicket.util.time.DurationgetTimeout(int pageId)voidlockPage(int pageId)Acquire a lock to a pagevoidunlockAllPages()Unlocks all pages locked by this threadvoidunlockPage(int pageId)Unlocks a single page locked by the current thread.
-
-
-
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
-
lockPage
public void lockPage(int pageId) throws CouldNotLockPageExceptionAcquire 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
-
-