Package org.htmlunit
Class WaitingRefreshHandler
java.lang.Object
org.htmlunit.WaitingRefreshHandler
- All Implemented Interfaces:
RefreshHandler
This refresh handler waits the specified number of seconds (or a user defined maximum)
before refreshing the specified page, using the specified URL. Waiting happens
on the current thread
If you want a refresh handler that ignores the wait time, see
ImmediateRefreshHandler.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new refresh handler that will always wait whatever time the server or content asks.WaitingRefreshHandler(int maxwait) Creates a new refresh handler that will wait whatever time the server or content asks, unless it it longer thanmaxwait. -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleRefresh(Page page, URL url, int requestedWait) Refreshes the specified page using the specified URL after the specified number of seconds.
-
Constructor Details
-
WaitingRefreshHandler
public WaitingRefreshHandler(int maxwait) Creates a new refresh handler that will wait whatever time the server or content asks, unless it it longer thanmaxwait. A value ofmaxwaitthat is less than1will cause the refresh handler to always wait for whatever time the server or content requests.- Parameters:
maxwait- the maximum wait time before the refresh (in seconds)
-
WaitingRefreshHandler
public WaitingRefreshHandler()Creates a new refresh handler that will always wait whatever time the server or content asks.
-
-
Method Details
-
handleRefresh
Refreshes the specified page using the specified URL after the specified number of seconds.- Specified by:
handleRefreshin interfaceRefreshHandler- Parameters:
page- the page that is going to be refreshedurl- the URL where the new page will be loadedrequestedWait- the number of seconds to wait before reloading the page; if this is greater thanmaxwaitthenmaxwaitwill be used instead- Throws:
IOException- if the refresh fails
-