}
private ConnectorConnectionPool getConnectorConnectionPool(
com.sun.enterprise.config.serverbeans.ConnectorConnectionPool
domainCcp) throws Exception {
ConnectorConnectionPool ccp =
new ConnectorConnectionPool(domainCcp.getName());
ccp.setSteadyPoolSize(domainCcp.getSteadyPoolSize());
ccp.setMaxPoolSize(domainCcp.getMaxPoolSize());
ccp.setMaxWaitTimeInMillis(domainCcp.getMaxWaitTimeInMillis());
ccp.setPoolResizeQuantity(domainCcp.getPoolResizeQuantity());
ccp.setIdleTimeoutInSeconds(domainCcp.getIdleTimeoutInSeconds());
ccp.setFailAllConnections(domainCcp.isFailAllConnections());
ccp.setAuthCredentialsDefinedInPool(
isAuthCredentialsDefinedInPool(domainCcp));
//The line below will change for 9.0. We will get this from
//the domain.xml
ccp.setConnectionValidationRequired(domainCcp.isIsConnectionValidationRequired());
String txSupport = domainCcp.getTransactionSupport();
int txSupportIntVal = parseTransactionSupportString(txSupport);
if (txSupportIntVal == -1) {
//if transaction-support attribute is null load the value
//from the ra.xml
if (_logger.isLoggable(Level.FINE)) {
_logger.fine("Got transaction-support attr null from domain.xml");
}
txSupportIntVal = ConnectionPoolObjectsUtils.getTransactionSupportFromRaXml(
domainCcp.getResourceAdapterName());
} else {
//We got some valid transaction-support attribute value
//so go figure if it is valid.
//The tx support is valid if it is less-than/equal-to
//the value specified in the ra.xml
if (!isTxSupportConfigurationSane(txSupportIntVal,
domainCcp.getResourceAdapterName())) {
String i18nMsg = localStrings.getString(
"ccp_deployer.incorrect_tx_support");
ConnectorRuntimeException cre = new
ConnectorRuntimeException(i18nMsg);
_logger.log(Level.SEVERE, "rardeployment.incorrect_tx_support",
ccp.getName());
throw cre;
}
}
if (_logger.isLoggable(Level.FINE)) {
_logger.fine("setting txSupportVal to " + txSupportIntVal +
" in pool " + domainCcp.getName());
}
ccp.setTransactionSupport(txSupportIntVal);
//Always for ccp
ccp.setNonComponent(false);
ccp.setNonTransactional(false);
ccp.setConnectionLeakTracingTimeout(domainCcp.getConnectionLeakTimeoutInSeconds());
ccp.setConnectionReclaim(domainCcp.isConnectionLeakReclaim());
ccp.setMatchConnections(domainCcp.isMatchConnections());
ccp.setAssociateWithThread(domainCcp.isAssociateWithThread());
boolean lazyConnectionEnlistment = domainCcp.isLazyConnectionEnlistment();
boolean lazyConnectionAssociation = domainCcp.isLazyConnectionAssociation();
if (lazyConnectionAssociation) {
if (lazyConnectionEnlistment) {
ccp.setLazyConnectionAssoc(true);
ccp.setLazyConnectionEnlist(true);
} else {
_logger.log(Level.SEVERE,
"conn_pool_obj_utils.lazy_enlist-lazy_assoc-invalid-combination",
domainCcp.getName());
String i18nMsg = localStrings.getString(
"cpou.lazy_enlist-lazy_assoc-invalid-combination", domainCcp.getName());
throw new RuntimeException(i18nMsg);
}
} else {
ccp.setLazyConnectionAssoc(lazyConnectionAssociation);
ccp.setLazyConnectionEnlist(lazyConnectionEnlistment);
}
ccp.setMaxConnectionUsage(domainCcp.getMaxConnectionUsageCount());
ccp.setValidateAtmostOncePeriod(
domainCcp.getValidateAtmostOncePeriodInSeconds());
ccp.setConCreationRetryAttempts(
domainCcp.getConnectionCreationRetryAttempts());
ccp.setConCreationRetryInterval(
domainCcp.getConnectionCreationRetryIntervalInSeconds());
//IMPORTANT
//Here all properties that will be checked by the
//convertElementPropertyToPoolProperty method need to be set to