public static Reference createReference(String instanceClassName,
JNDIStorableInterface po) throws NamingException {
if (log.isTraceEnabled()) {
log.trace("Creating reference: " + instanceClassName + "," + po);
}
Reference result = new Reference(instanceClassName, JNDIReferenceFactory.class.getName(), null);
try {
Properties props = po.getProperties();
for (Enumeration iter = props.propertyNames(); iter.hasMoreElements();) {
String key = (String)iter.nextElement();
String value = props.getProperty(key);
javax.naming.StringRefAddr addr = new javax.naming.StringRefAddr(key, value);
result.add(addr);
}
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new NamingException(e.getMessage());
}
return result;
}
Create a Reference instance from a JNDIStorable object |