private Object getResource(int txLevel, PoolManager poolmgr, ManagedConnectionFactory mcf, ResourceSpec spec,
Subject subject, ConnectionRequestInfo cxRequestInfo, ClientSecurityInfo info,
ConnectorDescriptor desc, boolean shareable)
throws PoolingException, ResourceAllocationException, IllegalStateException, RetryableUnavailableException {
ResourceAllocator alloc;
switch (txLevel) {
case ConnectorConstants.NO_TRANSACTION_INT:
alloc = new NoTxConnectorAllocator(poolmgr, mcf, spec, subject, cxRequestInfo, info, desc);
break;
case ConnectorConstants.LOCAL_TRANSACTION_INT:
alloc = new LocalTxConnectorAllocator(poolmgr, mcf, spec, subject, cxRequestInfo, info, desc, shareable);
break;
case ConnectorConstants.XA_TRANSACTION_INT:
if (rarName.equals(ConnectorRuntime.DEFAULT_JMS_ADAPTER)) {
shareable = false;
}
spec.markAsXA();
alloc = new ConnectorAllocator(poolmgr, mcf, spec, subject, cxRequestInfo, info, desc, shareable);
return poolmgr.getResource(spec, alloc, info);
default:
String i18nMsg = getLocalStrings().getString("con_mgr.illegal_tx_level", txLevel + " ");
throw new IllegalStateException(i18nMsg);
}
return poolmgr.getResource(spec, alloc, info);
}