31 |
StationDAO stationDao = new StationDAO(); |
StationDAO stationDao = new StationDAO(); |
32 |
|
|
33 |
private boolean useTempSite; |
private boolean useTempSite; |
34 |
|
private int replyTimeout; |
35 |
|
|
36 |
public DepartureFetcher(boolean tempSite, int cacheTimeout) { |
public DepartureFetcher(boolean tempSite, int cacheTimeout, int replyTimeout) { |
37 |
|
this.replyTimeout = replyTimeout; |
38 |
useTempSite = tempSite; |
useTempSite = tempSite; |
39 |
cache = new TimeoutMap<String,DepartureBean>(cacheTimeout); |
cache = new TimeoutMap<String,DepartureBean>(cacheTimeout); |
40 |
} |
} |
121 |
|
|
122 |
|
|
123 |
//logger.info("URI: " + uri); |
//logger.info("URI: " + uri); |
124 |
JsoupInvocation wrapper = new JsoupInvocation( new URL(uri), 2500); |
JsoupInvocation wrapper = new JsoupInvocation( new URL(uri), replyTimeout); |
125 |
CircuitBreaker breaker = CircuitBreakerManager.getManager().getCircuitBreaker("banedk"); |
CircuitBreaker breaker = CircuitBreakerManager.getManager().getCircuitBreaker("banedk"); |
126 |
|
|
127 |
Document page = (Document) breaker.invoke(wrapper); |
Document page = (Document) breaker.invoke(wrapper); |