summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/utils/ObjectProperties.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-06-05 14:13:37 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-06-05 14:13:37 +0200
commitcedb32b6b7a799ef4142b418e64d3538cf604af1 (patch)
tree20b6975f944132485beff9304869df0ac589da36 /src/main/java/com/c2kernel/utils/ObjectProperties.java
parent28f6763508612fadcc34d87cff383e6a5aef2ad6 (diff)
Recreate old Authenticator interface as 'ProxyLogin'
Server boots with new lookup interface.
Diffstat (limited to 'src/main/java/com/c2kernel/utils/ObjectProperties.java')
-rw-r--r--src/main/java/com/c2kernel/utils/ObjectProperties.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/com/c2kernel/utils/ObjectProperties.java b/src/main/java/com/c2kernel/utils/ObjectProperties.java
index 1e9db8b..731b009 100644
--- a/src/main/java/com/c2kernel/utils/ObjectProperties.java
+++ b/src/main/java/com/c2kernel/utils/ObjectProperties.java
@@ -151,11 +151,17 @@ public class ObjectProperties extends Properties {
}
}
- public Object getInstance(String propName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
- Object prop = getObject(propName);
+ public Object getInstance(String propName, Object defaultVal) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+ Object prop = getObject(propName, defaultVal);
+ if (prop == null || prop.equals(""))
+ throw new InstantiationException("Property '"+propName+"' was not defined. Cannot instantiate.");
if (prop instanceof String)
return Class.forName((String)prop).newInstance();
return prop;
+ }
+
+ public Object getInstance(String propName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+ return getInstance(propName, null);
}
}