if (props == null)
props = Collections.EMPTY_MAP;
else if (!props.isEmpty())
props = new HashMap(props);
OpenJPAConfiguration conf = getConfiguration();
Log log = conf.getLog(OpenJPAConfiguration.LOG_RUNTIME);
String user = (String) Configurations.removeProperty("ConnectionUserName", props);
if (user == null)
user = conf.getConnectionUserName();
String pass = (String) Configurations.removeProperty("ConnectionPassword", props);
if (pass == null)
pass = conf.getConnectionPassword();
String str = (String) Configurations.removeProperty("TransactionMode", props);
boolean managed;
if (str == null)
managed = conf.isTransactionModeManaged();
else {
Value val = conf.getValue("TransactionMode");
managed = Boolean.parseBoolean(val.unalias(str));
}
Object obj = Configurations.removeProperty("ConnectionRetainMode", props);
int retainMode;
if (obj instanceof Number) {
retainMode = ((Number) obj).intValue();
} else if (obj == null) {
retainMode = conf.getConnectionRetainModeConstant();
} else {
Value val = conf.getValue("ConnectionRetainMode");
try {
retainMode = Integer.parseInt(val.unalias((String) obj));
} catch (Exception e) {
throw new ArgumentException(_loc.get("bad-em-prop", "openjpa.ConnectionRetainMode", obj),
new Throwable[]{ e }, obj, true);