/[projects]/android/TrainInfoService/src/dk/thoerup/traininfoservice/TraininfoSettings.java
ViewVC logotype

Annotation of /android/TrainInfoService/src/dk/thoerup/traininfoservice/TraininfoSettings.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1372 - (hide annotations) (download)
Thu Apr 21 05:51:25 2011 UTC (13 years, 1 month ago) by torben
File size: 1192 byte(s)
Use a enum to select backend
1 torben 1303 package dk.thoerup.traininfoservice;
2    
3 torben 1341 import java.util.logging.Logger;
4    
5 torben 1340 import javax.servlet.ServletContext;
6    
7 torben 1316 import dk.thoerup.circuitbreaker.config.BreakerConfig;
8 torben 1320 import dk.thoerup.webconfig.ConfigVariable;
9 torben 1340 import dk.thoerup.webconfig.ContextConfigLoader;
10 torben 1344 import dk.thoerup.webconfig.ReloadConfigMethod;
11 torben 1303
12 torben 1316
13     public class TraininfoSettings implements BreakerConfig{
14 torben 1372 public enum Backend {
15     Azure,
16     Mobile
17     }
18 torben 1303
19 torben 1341 Logger logger = Logger.getLogger(TraininfoSettings.class.getName() );
20    
21 torben 1320 @ConfigVariable
22 torben 1372 Backend backend;
23 torben 1303
24 torben 1325 @ConfigVariable(description = "Circuitbreaker", readonly = true)
25 torben 1303 int banedk_threshold;
26    
27 torben 1325 @ConfigVariable(readonly = true)
28 torben 1303 int banedk_timeout;
29    
30 torben 1325 @ConfigVariable(readonly = true)
31 torben 1303 int cache_timeout;
32    
33 torben 1320 @ConfigVariable(readonly = true)
34 torben 1303 int stats_interval;
35    
36 torben 1320 @ConfigVariable
37 torben 1303 int reply_timeout;
38 torben 1345
39 torben 1303
40 torben 1372 public Backend getBackend() {
41     return backend;
42 torben 1303 }
43    
44    
45     public int getCacheTimeout() {
46     return cache_timeout;
47     }
48 torben 1316
49 torben 1303 public int getStatsInterval() {
50     return stats_interval;
51 torben 1316 }
52 torben 1303
53     public int getReplyTimeout() {
54     return reply_timeout;
55     }
56 torben 1316
57     @Override
58     public int getTreshold() {
59     return banedk_threshold;
60     }
61    
62     @Override
63     public int getTimeout() {
64     return banedk_timeout;
65     }
66 torben 1303 }

  ViewVC Help
Powered by ViewVC 1.1.20