Class PageProvider

  • All Implemented Interfaces:
    Serializable, IPageProvider, org.apache.wicket.util.io.IClusterable
    Direct Known Subclasses:
    PageAndComponentProvider

    public class PageProvider
    extends Object
    implements IPageProvider, org.apache.wicket.util.io.IClusterable
    Provides page instance for request handlers. Each of the constructors has just enough information to get existing or create new page instance. Requesting or creating page instance is deferred until getPageInstance() is called.

    Purpose of this class is to reduce complexity of both IRequestMappers and IRequestHandlers. IRequestMapper examines the URL, gathers all relevant information about the page in the URL (combination of page id, page class, page parameters and render count), creates PageProvider object and creates a IRequestHandler instance that can use the PageProvider to access the page.

    Apart from simplifying IRequestMappers and IRequestHandlers PageProvider also helps performance because creating or obtaining page from IPageManager is delayed until the IRequestHandler actually requires the page.

    Author:
    Matej Knopp
    See Also:
    Serialized Form
    • Constructor Detail

      • PageProvider

        public PageProvider​(Integer pageId,
                            Integer renderCount)
        Creates a new page provider object. Upon calling of getPageInstance() this provider will return page instance with specified id.
        Parameters:
        pageId -
        renderCount - optional argument
      • PageProvider

        public PageProvider​(Integer pageId,
                            Class<? extends IRequestablePage> pageClass,
                            Integer renderCount)
        Creates a new page provider object. Upon calling of getPageInstance() this provider will return page instance with specified id if it exists and it's class matches pageClass. If none of these is true new page instance will be created.
        Parameters:
        pageId -
        pageClass -
        renderCount - optional argument
      • PageProvider

        public PageProvider​(Integer pageId,
                            Class<? extends IRequestablePage> pageClass,
                            org.apache.wicket.request.mapper.parameter.PageParameters pageParameters,
                            Integer renderCount)
        Creates a new page provider object. Upon calling of getPageInstance() this provider will return page instance with specified id if it exists and it's class matches pageClass. If none of these is true new page instance will be created.
        Parameters:
        pageId -
        pageClass -
        pageParameters -
        renderCount - optional argument
      • PageProvider

        public PageProvider​(Class<? extends IRequestablePage> pageClass,
                            org.apache.wicket.request.mapper.parameter.PageParameters pageParameters)
        Creates a new page provider object. Upon calling of getPageInstance() this provider will return new instance of page with specified class.
        Parameters:
        pageClass -
        pageParameters -