/[projects]/dao/DaoAdresseService/src/main/java/dk/daoas/daoadresseservice/GoogleStreetnameHelper.java
ViewVC logotype

Diff of /dao/DaoAdresseService/src/main/java/dk/daoas/daoadresseservice/GoogleStreetnameHelper.java

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

revision 2566 by torben, Thu Jun 4 19:29:39 2015 UTC revision 2567 by torben, Sun Jun 7 18:09:16 2015 UTC
# Line 35  public class GoogleStreetnameHelper impl Line 35  public class GoogleStreetnameHelper impl
35                  if (conf.useGoogle == false)                  if (conf.useGoogle == false)
36                          return null;                          return null;
37                                    
                 limiter.acquire();  
38    
39                  result.google = true;                  result.google = true;
40                                    
41                  try {                  try {
42                          GoogleInvocation wrapper = new GoogleInvocation( conf, request.postnr, request.vejnavn );                          GoogleInvocation wrapper = new GoogleInvocation( limiter, conf, request.postnr, request.vejnavn );
43                          CircuitBreaker breaker = CircuitBreakerManager.getManager().getCircuitBreaker("google");                          CircuitBreaker breaker = CircuitBreakerManager.getManager().getCircuitBreaker("google");
44    
45                                                    
# Line 58  public class GoogleStreetnameHelper impl Line 57  public class GoogleStreetnameHelper impl
57                  ServiceConfig conf;                  ServiceConfig conf;
58                  int postnr;                  int postnr;
59                  String vejnavn;                  String vejnavn;
60                    RateLimiter limiter;
61                                    
62                  public GoogleInvocation(ServiceConfig conf, int postnr, String vejnavn) {                  public GoogleInvocation(RateLimiter limiter, ServiceConfig conf, int postnr, String vejnavn) {
63                            this.limiter = limiter;
64                          this.conf = conf;                          this.conf = conf;
65                          this.postnr= postnr;                          this.postnr= postnr;
66                          this.vejnavn = vejnavn;                          this.vejnavn = vejnavn;
# Line 68  public class GoogleStreetnameHelper impl Line 69  public class GoogleStreetnameHelper impl
69    
70                  @Override                  @Override
71                  public String proceed() throws Exception {                  public String proceed() throws Exception {
72                    
73                            limiter.acquire();
74                                                    
75                          final Geocoder geocoder;                          final Geocoder geocoder;
76                          if ( conf.googleApiKey != null ) {                          if ( conf.googleApiKey != null ) {

Legend:
Removed from v.2566  
changed lines
  Added in v.2567

  ViewVC Help
Powered by ViewVC 1.1.20