diff options
Diffstat (limited to 'src/main/java/com/c2kernel/utils')
| -rw-r--r-- | src/main/java/com/c2kernel/utils/LocalObjectLoader.java | 8 | ||||
| -rw-r--r-- | src/main/java/com/c2kernel/utils/ObjectProperties.java | 8 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/main/java/com/c2kernel/utils/LocalObjectLoader.java b/src/main/java/com/c2kernel/utils/LocalObjectLoader.java index 307cd97..f0d8928 100644 --- a/src/main/java/com/c2kernel/utils/LocalObjectLoader.java +++ b/src/main/java/com/c2kernel/utils/LocalObjectLoader.java @@ -1,6 +1,6 @@ package com.c2kernel.utils;
-import java.util.Enumeration;
+import java.util.Iterator;
import com.c2kernel.common.InvalidDataException;
import com.c2kernel.common.ObjectNotFoundException;
@@ -23,10 +23,10 @@ public class LocalObjectLoader { throws ObjectNotFoundException
{
DomainPath defRoot = new DomainPath(root);
- Enumeration<Path> e = Gateway.getLDAPLookup().search(defRoot, name);
+ Iterator<Path> e = Gateway.getLookup().search(defRoot, name);
ItemProxy defProxy = null; int currentLayer = -1;
- while (e.hasMoreElements()) {
- DomainPath defPath = (DomainPath)e.nextElement();
+ while (e.hasNext()) {
+ DomainPath defPath = (DomainPath)e.next();
ItemProxy thisProxy = Gateway.getProxyManager().getProxy(defPath);
int thisLayer;
try {
diff --git a/src/main/java/com/c2kernel/utils/ObjectProperties.java b/src/main/java/com/c2kernel/utils/ObjectProperties.java index dd4a59d..1e9db8b 100644 --- a/src/main/java/com/c2kernel/utils/ObjectProperties.java +++ b/src/main/java/com/c2kernel/utils/ObjectProperties.java @@ -150,6 +150,12 @@ public class ObjectProperties extends Properties { Logger.msg(" "+name+" ("+getObject(name).getClass().getSimpleName()+"): "+getObject(name).toString());
}
}
-
+
+ public Object getInstance(String propName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+ Object prop = getObject(propName);
+ if (prop instanceof String)
+ return Class.forName((String)prop).newInstance();
+ return prop;
+ }
}
|
