1 38 package com.gargoylesoftware.htmlunit; 39 40 import java.io.IOException ; 41 import java.net.URL ; 42 43 55 public class ThreadedRefreshHandler implements RefreshHandler { 56 57 64 public void handleRefresh(final Page page, final URL url, final int seconds) { 65 final Thread thread = new Thread ( "ThreadedRefreshHandler Thread" ) { 66 public void run() { 67 try { 68 new WaitingRefreshHandler().handleRefresh(page, url, seconds); 69 } 70 catch( final IOException e ) { 71 page.getEnclosingWindow().getWebClient().getLog().error( "Unable to refresh page!", e ); 72 throw new RuntimeException ("Unable to refresh page!", e); 73 } 74 } 75 }; 76 thread.start(); 77 } 78 79 } 80 | Popular Tags |