- System.out.println("# OSGiBOOT DBG # " + obj);
- }
-
- protected void warn(Object obj) {
- System.out.println("# OSGiBOOT WARN # " + obj);
- // Because of a weird bug under Windows when starting it in a forked VM
- // if (System.getProperty("os.name").contains("Windows"))
- // System.out.println("# WARN " + obj);
- // else
- // System.err.println("# WARN " + obj);
- }
-
- protected String getProperty(String name, String defaultValue) {
- final String value;
- if (defaultValue != null)
- value = System.getProperty(name, defaultValue);
- else
- value = System.getProperty(name);
-
- if (value == null || value.equals(""))
- return null;
- else
- return value;
- }
-
- protected String getProperty(String name) {
- return getProperty(name, null);
- }
-
- protected String getPropertyCompat(String name, String oldName) {
- return getPropertyCompat(name, oldName, null);
- }
-
- protected String getPropertyCompat(String name, String oldName,
- String defaultValue) {
- String res = null;
-
- if (defaultValue != null) {
- res = getProperty(name, defaultValue);
- if (res.equals(defaultValue)) {
- res = getProperty(oldName, defaultValue);
- if (!res.equals(defaultValue))
- warnDeprecated(name, oldName);
- }
- } else {
- res = getProperty(name, null);
- if (res == null) {
- res = getProperty(oldName, null);
- if (res != null)
- warnDeprecated(name, oldName);
- }
- }
- return res;
- }
-
- protected void warnDeprecated(String name, String oldName) {
- warn("Property '" + oldName
- + "' is deprecated and will be removed soon, use '" + name
- + "' instead.");