com.gargoylesoftware.htmlunit
Class WaitingRefreshHandler

java.lang.Object
  extended by com.gargoylesoftware.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 thread If you want a refresh handler that ignores the wait time, see ImmediateRefreshHandler.

Version:
$Revision: 1.3 $
Author:
Mike Bowler, Daniel Gredler

Constructor Summary
WaitingRefreshHandler()
 Create a WaitingRefreshHandler that will always wait whatever time the server or content asks.
WaitingRefreshHandler(int maxwait)
 Create a WaitingRefreshHandler that will wait whatever time the server or content asks unless it it longer than maxwait.
 
Method Summary
 void handleRefresh(Page page, java.net.URL url, int requestedWait)
 Refreshes the specified page using the specified URL after the specified number of seconds.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WaitingRefreshHandler

public WaitingRefreshHandler()
Create a WaitingRefreshHandler that will always wait whatever time the server or content asks.


WaitingRefreshHandler

public WaitingRefreshHandler(int maxwait)
Create a WaitingRefreshHandler that will wait whatever time the server or content asks unless it it longer than maxwait.

Parameters:
maxwait - The maximum wait time before the refresh (in seconds). A value less than one (1) will cause WaitingRefreshHandler to wait for 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 interface RefreshHandler
Parameters:
page - The page that is going to be refreshed.
url - The URL where the new page will be loaded.
requestedWait - The number of seconds to wait before reloading the page. If this is greater than maxwait than maxwait will be used instead.
Throws:
java.io.IOException - if the refresh fails


Copyright © 2003-2016 AppPerfect Corporation. All Rights Reserved.