Package org.htmlunit
Class WaitingRefreshHandler
- java.lang.Object
-
- org.htmlunit.WaitingRefreshHandler
-
- All Implemented Interfaces:
RefreshHandler
public class WaitingRefreshHandler extends java.lang.Object implements 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 threadIf you want a refresh handler that ignores the wait time, see
ImmediateRefreshHandler
.
-
-
Constructor Summary
Constructors Constructor Description WaitingRefreshHandler()
Creates 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handleRefresh(Page page, java.net.URL url, int requestedWait)
Refreshes the specified page using the specified URL after the specified number of seconds.
-
-
-
Constructor Detail
-
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 ofmaxwait
that is less than1
will 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 Detail
-
handleRefresh
public void handleRefresh(Page page, java.net.URL url, int requestedWait) throws java.io.IOException
Refreshes the specified page using the specified URL after the specified number of seconds.- Specified by:
handleRefresh
in 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 thanmaxwait
thenmaxwait
will be used instead- Throws:
java.io.IOException
- if the refresh fails
-
-