String poolResizeQuantity = null;
String idleTimeoutInSecs = null;
String maxWaitTimeInMillis = null;
String failAllConnections = null;
String transactionSupport = null;
ParameterMap parameters = new ParameterMap();
if(props != null){
Enumeration keys = props.keys();
Properties tmpProps = new Properties();
while(keys.hasMoreElements())
{
String propKey = (String) keys.nextElement();
if ("steady-pool-size".equals(propKey))
steadyPoolSize = props.getProperty(propKey);
else if ("max-pool-size".equals(propKey))
maxPoolSize = props.getProperty(propKey);
else if ("pool-resize-quantity".equals(propKey))
poolResizeQuantity = props.getProperty(propKey);
else if ("idle-timeout-in-seconds".equals(propKey))
idleTimeoutInSecs = props.getProperty(propKey);
else if ("max-wait-time-in-millis".equals(propKey))
maxWaitTimeInMillis = props.getProperty(propKey);
else if ("transaction-support".equals(propKey))
transactionSupport = props.getProperty(propKey);
else if("fail-all-connections".equals(propKey))
failAllConnections = props.getProperty(propKey);
else{
if ("AddressList".equals(propKey)){
String addressListProp = props.getProperty(propKey);
props.setProperty(propKey, "\""+ addressListProp + "\"");
}
else if ("Password".equals(propKey)){
String password = props.getProperty(propKey);
if (isPasswordAlias(password))
//If the string is a password alias, it needs to be escapted with another pair of quotes...
props.setProperty(propKey, "\"" + password + "\"");
}
tmpProps.setProperty(propKey, props.getProperty(propKey));
}
}
if (tmpProps.size() >0)
{
String propString = "";
for (java.util.Map.Entry<Object, Object>prop : tmpProps.entrySet()) {
propString += prop.getKey() + "=" + prop.getValue() + ":";
}
propString = propString.substring(0, propString.length());
parameters.set("property", propString);
}
}
//parameters.set("restype", resourceType);
parameters.set(DEFAULT_OPERAND, jndiName);
parameters.set("poolname", jndiName);
if(description != null)
parameters.set("description", description);
// Get the default res adapter name from Connector-runtime
String raName = DEFAULT_JMS_ADAPTER;
parameters.set("raname", raName);
parameters.set("connectiondefinition", resourceType);
parameters.set("maxpoolsize", (maxPoolSize == null) ? "250" : maxPoolSize);
parameters.set("steadypoolsize", (steadyPoolSize == null) ? "1" : steadyPoolSize);
if (poolResizeQuantity != null) {
parameters.set("poolresize", poolResizeQuantity);
}
if (idleTimeoutInSecs != null) {
parameters.set("idletimeout", idleTimeoutInSecs);
}
if (maxWaitTimeInMillis != null) {
parameters.set("maxwait", maxWaitTimeInMillis);
}
if (failAllConnections != null) {
parameters.set("failconnection",failAllConnections);
}
if (transactionSupport != null) {
parameters.set("transactionsupport", transactionSupport);
}
return parameters;
}