Class AsynchronousPageStore

  • All Implemented Interfaces:
    IPageStore

    public class AsynchronousPageStore
    extends DelegatingPageStore
    Facade for IPageStore moving addPage(IPageContext, IManageablePage) to a worker thread.

    Creates an AsynchronousPageStore.PendingAdd for addPage(IPageContext, IManageablePage) and puts ito a queue. Later AsynchronousPageStore.PageAddingRunnable reads in blocking manner from queue and performs the add.

    It starts only one instance of AsynchronousPageStore.PageAddingRunnable because all we need is to make the page storing asynchronous. We don't want to write concurrently in the wrapped IPageStore, though it may happen in the extreme case when the queue is full. These cases should be avoided.

    Author:
    Matej Knopp, manuelbarzi