com.gargoylesoftware.htmlunit
Class NiceRefreshHandler
java.lang.Object
com.gargoylesoftware.htmlunit.ImmediateRefreshHandler
com.gargoylesoftware.htmlunit.NiceRefreshHandler
- All Implemented Interfaces:
- RefreshHandler, Serializable
public class NiceRefreshHandler
- extends ImmediateRefreshHandler
This refresh handler performs an immediate refresh if the refresh delay is
less or equal to the configured time and otherwise ignores totally the refresh instruction.
- Version:
- $Revision: 7931 $
- Author:
- Marc Guillemot
- See Also:
- Serialized Form
|
Constructor Summary |
NiceRefreshHandler(int maxDelay)
Creates a new refresh handler that will immediately refresh if the refresh delay is no
longer than maxDelay. |
|
Method Summary |
void |
handleRefresh(Page page,
URL url,
int requestedWait)
Refreshes the specified page using the specified URL immediately if the requestedWait
not larget that the maxDelay. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NiceRefreshHandler
public NiceRefreshHandler(int maxDelay)
- Creates a new refresh handler that will immediately refresh if the refresh delay is no
longer than maxDelay. No refresh will be perform at all for refresh values
larger than maxDelay.
- Parameters:
maxDelay - the maximum refreshValue (in seconds) that should cause a refresh
handleRefresh
public void handleRefresh(Page page,
URL url,
int requestedWait)
throws IOException
- Refreshes the specified page using the specified URL immediately if the requestedWait
not larget that the maxDelay. Does nothing otherwise.
- Specified by:
handleRefresh in interface RefreshHandler- Overrides:
handleRefresh in class ImmediateRefreshHandler
- 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
- Throws:
IOException - if the refresh fails
Copyright © 2002–2013 Gargoyle Software Inc.. All rights reserved.