/[projects]/android/TrainInfoServiceGoogle/src/dk/thoerup/traininfoservice/banedk/TimetableFetcher.java
ViewVC logotype

Diff of /android/TrainInfoServiceGoogle/src/dk/thoerup/traininfoservice/banedk/TimetableFetcher.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 389 by torben, Fri Oct 2 17:18:31 2009 UTC revision 451 by torben, Tue Oct 20 10:32:19 2009 UTC
# Line 5  import java.io.IOException; Line 5  import java.io.IOException;
5  import java.net.URL;  import java.net.URL;
6  import java.util.ArrayList;  import java.util.ArrayList;
7  import java.util.List;  import java.util.List;
8    import java.util.Map;
9  import java.util.logging.Logger;  import java.util.logging.Logger;
10    
11  import com.gargoylesoftware.htmlunit.Page;  import com.gargoylesoftware.htmlunit.Page;
# Line 14  import com.gargoylesoftware.htmlunit.htm Line 15  import com.gargoylesoftware.htmlunit.htm
15  import com.gargoylesoftware.htmlunit.html.HtmlElement;  import com.gargoylesoftware.htmlunit.html.HtmlElement;
16  import com.gargoylesoftware.htmlunit.html.HtmlPage;  import com.gargoylesoftware.htmlunit.html.HtmlPage;
17    
18    import dk.thoerup.curcuitbreaker.CircuitBreaker;
19    import dk.thoerup.curcuitbreaker.CircuitBreakerManager;
20    
21  public class TimetableFetcher {  public class TimetableFetcher {
22                    
23          class NullRefreshHandler implements RefreshHandler {          class NullRefreshHandler implements RefreshHandler {
# Line 22  public class TimetableFetcher { Line 26  public class TimetableFetcher {
26                                    
27          }          }
28                                    
29          TimeoutCache<String, List<TimetableBean>> cache = new TimeoutCache<String,List<TimetableBean>>(120 * 1000);          Map<String, List<TimetableBean>> cache = new TimeoutMap<String,List<TimetableBean>>(120 * 1000);
30                    
31                    
32          Logger logger = Logger.getLogger(TimetableFetcher.class.getName());          Logger logger = Logger.getLogger(TimetableFetcher.class.getName());
# Line 54  public class TimetableFetcher { Line 58  public class TimetableFetcher {
58              webClient.setCssEnabled(false);              webClient.setCssEnabled(false);
59                            
60                            
61              final HtmlPage page = webClient.getPage(url);              BanedkInvocation wrapper = new BanedkInvocation(webClient, url);
62                CircuitBreaker breaker = CircuitBreakerManager.getManager().getCircuitBreaker("banedk");
63                            
64                HtmlPage page = (HtmlPage) breaker.invoke(wrapper);
65                        
66                            
67              boolean currentStation = false;              boolean currentStation = false;
68              boolean currentStationSaved = false;              boolean currentStationSaved = false;

Legend:
Removed from v.389  
changed lines
  Added in v.451

  ViewVC Help
Powered by ViewVC 1.1.20