Clustering support
This commit is contained in:
1 parent
6075ef221f
commit
99c73a9cc7
67 files changed
+3250
-176
No files matched your search
@@ -121,6 +121,17 @@ public class Config {
|
||||
return v != null ? Boolean.parseBoolean(v) : defaultValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Scope scope(String... scope) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(prefix + ".");
|
||||
for (String s : scope) {
|
||||
sb.append(s);
|
||||
sb.append(".");
|
||||
}
|
||||
return new SystemPropertiesScope(sb.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,5 +157,7 @@ public class Config {
|
||||
|
||||
Boolean getBoolean(String key, Boolean defaultValue);
|
||||
|
||||
Scope scope(String... scope);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,12 +7,18 @@ import java.util.Date;
|
||||
*/
|
||||
public class Time {
|
||||
|
||||
private static int offset;
|
||||
|
||||
public static int currentTime() {
|
||||
return (int) (System.currentTimeMillis() / 1000);
|
||||
return ((int) (System.currentTimeMillis() / 1000)) + offset;
|
||||
}
|
||||
|
||||
public static Date toDate(int time) {
|
||||
return new Date(((long) time ) * 1000);
|
||||
}
|
||||
|
||||
public static void setOffset(int offset) {
|
||||
Time.offset = offset;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user