1 |
package dk.thoerup.traininfoservice; |
package dk.thoerup.traininfoservice; |
2 |
|
|
3 |
|
import java.util.logging.Logger; |
4 |
|
|
5 |
import javax.servlet.ServletContext; |
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; |
import dk.thoerup.webconfig.ContextConfigLoader; |
10 |
import dk.thoerup.webconfig.ReloadConfig; |
import dk.thoerup.webconfig.ReloadConfigMethod; |
11 |
|
|
12 |
|
|
13 |
public class TraininfoSettings implements BreakerConfig{ |
public class TraininfoSettings implements BreakerConfig{ |
14 |
|
|
15 |
ServletContext cxt; |
Logger logger = Logger.getLogger(TraininfoSettings.class.getName() ); |
|
public TraininfoSettings(ServletContext cxt) { |
|
|
this.cxt = cxt; |
|
|
} |
|
16 |
|
|
17 |
@ConfigVariable |
@ConfigVariable |
18 |
boolean useazuresite; |
boolean useazuresite; |
31 |
|
|
32 |
@ConfigVariable |
@ConfigVariable |
33 |
int reply_timeout; |
int reply_timeout; |
34 |
|
|
|
@ReloadConfig |
|
|
public void reloadConfig() { |
|
|
System.out.println("Reloading config"); |
|
|
new ContextConfigLoader(cxt).loadConfig(this); |
|
|
} |
|
35 |
|
|
36 |
public boolean getUseAzureSite() { |
public boolean getUseAzureSite() { |
37 |
return useazuresite; |
return useazuresite; |
49 |
public int getReplyTimeout() { |
public int getReplyTimeout() { |
50 |
return reply_timeout; |
return reply_timeout; |
51 |
} |
} |
|
|
|
52 |
|
|
53 |
@Override |
@Override |
54 |
public int getTreshold() { |
public int getTreshold() { |