1 |
package dk.thoerup.traininfoservice; |
package dk.thoerup.traininfoservice; |
2 |
|
|
3 |
|
import javax.servlet.ServletContext; |
4 |
|
|
5 |
import dk.thoerup.circuitbreaker.config.BreakerConfig; |
import dk.thoerup.circuitbreaker.config.BreakerConfig; |
6 |
|
import dk.thoerup.webconfig.ConfigVariable; |
7 |
|
import dk.thoerup.webconfig.ContextConfigLoader; |
8 |
|
import dk.thoerup.webconfig.ReloadConfig; |
9 |
|
|
10 |
|
|
11 |
public class TraininfoSettings implements BreakerConfig{ |
public class TraininfoSettings implements BreakerConfig{ |
12 |
|
|
13 |
|
ServletContext cxt; |
14 |
|
public TraininfoSettings(ServletContext cxt) { |
15 |
|
this.cxt = cxt; |
16 |
|
} |
17 |
|
|
18 |
|
@ConfigVariable |
19 |
boolean useazuresite; |
boolean useazuresite; |
20 |
|
|
21 |
|
@ConfigVariable(description = "Circuitbreaker", readonly = true) |
22 |
int banedk_threshold; |
int banedk_threshold; |
23 |
|
|
24 |
|
@ConfigVariable(readonly = true) |
25 |
int banedk_timeout; |
int banedk_timeout; |
26 |
|
|
27 |
|
@ConfigVariable(readonly = true) |
28 |
int cache_timeout; |
int cache_timeout; |
29 |
|
|
30 |
|
@ConfigVariable(readonly = true) |
31 |
int stats_interval; |
int stats_interval; |
32 |
|
|
33 |
|
@ConfigVariable |
34 |
int reply_timeout; |
int reply_timeout; |
35 |
|
|
36 |
|
@ReloadConfig |
37 |
|
public void reloadConfig() { |
38 |
|
System.out.println("Reloading config"); |
39 |
|
new ContextConfigLoader(cxt).loadConfig(this); |
40 |
|
} |
41 |
|
|
42 |
public boolean getUseAzureSite() { |
public boolean getUseAzureSite() { |
43 |
return useazuresite; |
return useazuresite; |