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