aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/jogamp/common/Debug.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/jogamp/common/Debug.java')
-rw-r--r--src/java/jogamp/common/Debug.java73
1 files changed, 1 insertions, 72 deletions
diff --git a/src/java/jogamp/common/Debug.java b/src/java/jogamp/common/Debug.java
index cf07255..b8ed098 100644
--- a/src/java/jogamp/common/Debug.java
+++ b/src/java/jogamp/common/Debug.java
@@ -43,7 +43,7 @@ import java.security.*;
/** Helper routines for logging and debugging. */
-public class Debug {
+public class Debug extends PropertyAccess {
// Some common properties
private static boolean verbose;
private static boolean debugAll;
@@ -59,89 +59,18 @@ public class Debug {
return getIntProperty(property, jnlpAlias, localACC, 0);
}
- public static int getIntProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc, int defaultValue) {
- int i=defaultValue;
- try {
- String sv = Debug.getProperty(property, jnlpAlias, acc);
- if(null!=sv) {
- Integer iv = Integer.valueOf(sv);
- i = iv.intValue();
- }
- } catch (NumberFormatException nfe) {}
- return i;
- }
-
- public static long getLongProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc, long defaultValue) {
- long l=defaultValue;
- try {
- String sv = Debug.getProperty(property, jnlpAlias, acc);
- if(null!=sv) {
- Long lv = Long.valueOf(sv);
- l = lv.longValue();
- }
- } catch (NumberFormatException nfe) {}
- return l;
- }
-
static boolean getBooleanProperty(final String property, final boolean jnlpAlias) {
return getBooleanProperty(property, jnlpAlias, localACC);
}
- public static boolean getBooleanProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
- return Boolean.valueOf(Debug.getProperty(property, jnlpAlias, acc)).booleanValue();
- }
-
- public static boolean getBooleanProperty(boolean defaultValue, final String property, final boolean jnlpAlias, final AccessControlContext acc) {
- final String valueS = Debug.getProperty(property, jnlpAlias, acc);
- if(null != valueS) {
- return Boolean.valueOf(Debug.getProperty(property, jnlpAlias, acc)).booleanValue();
- }
- return defaultValue;
- }
-
static boolean isPropertyDefined(final String property, final boolean jnlpAlias) {
return isPropertyDefined(property, jnlpAlias, localACC);
}
- public static boolean isPropertyDefined(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
- return (Debug.getProperty(property, jnlpAlias, acc) != null) ? true : false;
- }
-
static String getProperty(final String property, final boolean jnlpAlias) {
return getProperty(property, jnlpAlias, localACC);
}
- public static String getProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
- String s=null;
- if(null!=acc && acc.equals(localACC)) {
- s = AccessController.doPrivileged(new PrivilegedAction<String>() {
- public String run() {
- String val=null;
- try {
- val = System.getProperty(property);
- } catch (Exception e) {}
- if(null==val && jnlpAlias && !property.startsWith(jnlp_prefix)) {
- try {
- val = System.getProperty(jnlp_prefix + property);
- } catch (Exception e) {}
- }
- return val;
- }
- });
- } else {
- try {
- s = System.getProperty(property);
- } catch (Exception e) {}
- if(null==s && jnlpAlias && !property.startsWith(jnlp_prefix)) {
- try {
- s = System.getProperty(jnlp_prefix + property);
- } catch (Exception e) {}
- }
- }
- return s;
- }
- public static final String jnlp_prefix = "jnlp." ;
-
public static boolean verbose() {
return verbose;
}