11 |
|
|
12 |
|
|
13 |
public class TraininfoSettings implements BreakerConfig{ |
public class TraininfoSettings implements BreakerConfig{ |
14 |
|
public enum Backend { |
15 |
|
Azure, |
16 |
|
Mobile |
17 |
|
} |
18 |
|
|
19 |
Logger logger = Logger.getLogger(TraininfoSettings.class.getName() ); |
Logger logger = Logger.getLogger(TraininfoSettings.class.getName() ); |
20 |
|
|
|
ServletContext cxt; |
|
|
public TraininfoSettings(ServletContext cxt) { |
|
|
this.cxt = cxt; |
|
|
} |
|
|
|
|
21 |
@ConfigVariable |
@ConfigVariable |
22 |
boolean useazuresite; |
Backend backend; |
23 |
|
|
24 |
@ConfigVariable(description = "Circuitbreaker", readonly = true) |
@ConfigVariable(description = "Circuitbreaker", readonly = true) |
25 |
int banedk_threshold; |
int banedk_threshold; |
35 |
|
|
36 |
@ConfigVariable |
@ConfigVariable |
37 |
int reply_timeout; |
int reply_timeout; |
38 |
|
|
|
@ReloadConfigMethod |
|
|
public void reloadConfig() { |
|
|
logger.info("Reloading config"); |
|
|
new ContextConfigLoader(cxt).loadConfig(this); |
|
|
} |
|
39 |
|
|
40 |
public boolean getUseAzureSite() { |
public Backend getBackend() { |
41 |
return useazuresite; |
return backend; |
42 |
} |
} |
43 |
|
|
44 |
|
|
53 |
public int getReplyTimeout() { |
public int getReplyTimeout() { |
54 |
return reply_timeout; |
return reply_timeout; |
55 |
} |
} |
|
|
|
56 |
|
|
57 |
@Override |
@Override |
58 |
public int getTreshold() { |
public int getTreshold() { |