public static boolean isTxSupportConfigurationSane(int txSupport, String raName) { int raXmlTxSupport = ConnectorConstants.UNDEFINED_TRANSACTION_INT; try { raXmlTxSupport = ConnectionPoolObjectsUtils.getTransactionSupportFromRaXml(raName); } catch (Exception e) { _logger.log(Level.WARNING, (e.getMessage() != null ? e.getMessage() : " ")); } if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "isTxSupportConfigSane:: txSupport => " + txSupport + " raXmlTxSupport => " + raXmlTxSupport); } return (txSupport <= raXmlTxSupport); }
public static boolean isPoolSystemPool(com.sun.enterprise.config.serverbeans.ConnectorConnectionPool domainCcp) { String poolName = domainCcp.getName(); return isPoolSystemPool(poolName); }
private int parseTransactionSupportString(String txSupport) { return ConnectionPoolObjectsUtils.parseTransactionSupportString(txSupport); }
Subject s = ConnectionPoolObjectsUtils.createSubject(mcf, prin); int txSupport = connectorConnectionPool.getTransactionSupport(); ((javax.resource.spi.TransactionSupport) mcf).getTransactionSupport(); int containerTxSupport = ConnectionPoolObjectsUtils.convertSpecTxSupportToContainerTxSupport(mcfTS); boolean isValidTxSupportLevel = ConnectionPoolObjectsUtils.isTxSupportConfigurationSane( containerTxSupport, activeResourceAdapter.getModuleName());
/** * Creates default ConnectorConnectionPool consisting of default * pool values. * * @param poolInfo Name of the pool * @return ConnectorConnectionPool created ConnectorConnectionPool instance */ public static ConnectorConnectionPool createDefaultConnectorPoolObject( PoolInfo poolInfo, String rarName) { ConnectorConnectionPool connectorPoolObj = new ConnectorConnectionPool(poolInfo); connectorPoolObj.setMaxPoolSize("20"); connectorPoolObj.setSteadyPoolSize("10"); connectorPoolObj.setMaxWaitTimeInMillis("7889"); connectorPoolObj.setIdleTimeoutInSeconds("789"); connectorPoolObj.setPoolResizeQuantity("2"); connectorPoolObj.setFailAllConnections(false); connectorPoolObj.setMatchConnections(true); //always setDefaultAdvancedPoolAttributes(connectorPoolObj); try { connectorPoolObj.setTransactionSupport(getTransactionSupportFromRaXml(rarName)); } catch (Exception ex) { if(_logger.isLoggable(Level.FINE)) { _logger.fine("error in setting txSupport"); } } return connectorPoolObj; }
ConnectionPoolObjectsUtils.createSunRaConnectorPoolObject(poolInfo, desc_, moduleName_); } else { connectorPoolObj = ConnectionPoolObjectsUtils.createDefaultConnectorPoolObject(poolInfo, moduleName_);
_logger.fine("Got transaction-support attr null from domain.xml"); txSupportIntVal = ConnectionPoolObjectsUtils.getTransactionSupportFromRaXml( domainCcp.getResourceAdapterName()); if (!ConnectionPoolObjectsUtils.isTxSupportConfigurationSane(txSupportIntVal, domainCcp.getResourceAdapterName())) {
/** * Returns a databaseName that is populated in pool's default DATABASENAME * @param poolInfo * @param mcf * @return * @throws javax.naming.NamingException if poolName lookup fails */ private String getDefaultDatabaseName(PoolInfo poolInfo, ManagedConnectionFactory mcf) throws NamingException { // All this to get the default user name and principal String databaseName = null; ConnectorConnectionPool connectorConnectionPool = null; try { String jndiNameForPool = ConnectorAdminServiceUtils.getReservePrefixedJNDINameForPool(poolInfo); Context ic = _runtime.getNamingManager().getInitialContext(); connectorConnectionPool = (ConnectorConnectionPool) ic.lookup(jndiNameForPool); } catch (NamingException ne) { throw ne; } databaseName = ccPoolAdmService.getPropertyValue("DATABASENAME", connectorConnectionPool); // To avoid using "" as the default databasename, try to get // the databasename from MCF. if (databaseName == null || databaseName.trim().equals("")) { databaseName = ConnectionPoolObjectsUtils.getValueFromMCF("DatabaseName", poolInfo, mcf); } return databaseName; }
ConnectionPoolObjectsUtils.createSubject(mcf, resourcePrincipal);
ccp.getTransactionSupport()); ((ConfigurableTransactionSupport)mcf).setTransactionSupport(ts);
/** * Creates connector connection pool pertaining to sun-ra.xml. This is * only for 1.0 complient rars. * * @throws ConnectorRuntimeException Thrown when pool creation fails. */ private void createSunRAConnectionPool() throws ConnectorRuntimeException { String defaultPoolName = connectorRuntime_.getDefaultPoolName( moduleName_, connectionDefs_[0].getConnectionFactoryIntf()); String sunRAPoolName = defaultPoolName + ConnectorConstants.SUN_RA_POOL; PoolInfo poolInfo = new PoolInfo(sunRAPoolName); ConnectorDescriptorInfo connectorDescriptorInfo = ConnectorDDTransformUtils.getConnectorDescriptorInfo(connectionDefs_[0]); connectorDescriptorInfo.setRarName(moduleName_); connectorDescriptorInfo.setResourceAdapterClassName(desc_.getResourceAdapterClass()); ConnectorConnectionPool connectorPoolObj = ConnectionPoolObjectsUtils.createSunRaConnectorPoolObject(poolInfo, desc_, moduleName_); connectorPoolObj.setConnectorDescriptorInfo(connectorDescriptorInfo); connectorRuntime_.createConnectorConnectionPool(connectorPoolObj); if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Created SUN-RA connection pool:", poolInfo); } String jndiName = (String) desc_.getSunDescriptor(). getResourceAdapter().getValue(ResourceAdapter.JNDI_NAME); ResourceInfo resourceInfo = new ResourceInfo(jndiName); connectorRuntime_.createConnectorResource(resourceInfo, poolInfo, null); if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Created SUN-RA connector resource : ", resourceInfo); } }
setDefaultAdvancedPoolAttributes(connectorPoolObj); connectorPoolObj.setTransactionSupport(getTransactionSupportFromRaXml(rarName)); } catch (Exception ex) { if(_logger.isLoggable(Level.FINE)) {
userName = ConnectionPoolObjectsUtils.getValueFromMCF("UserName", poolInfo, mcf); userName = ConnectionPoolObjectsUtils.getValueFromMCF("User", poolInfo, mcf); password = ConnectionPoolObjectsUtils.getValueFromMCF("Password", poolInfo, mcf);
subject = ConnectionPoolObjectsUtils.createSubject(mcf, null); } else { if (prin == null) { subject = pmd.getSubject(); } else { subject = ConnectionPoolObjectsUtils.createSubject(mcf, prin);
private int getTxSupport(String moduleName) { if (ConnectorConstants.JDBCXA_RA_NAME.equals(moduleName)) { return ConnectionPoolObjectsUtils.parseTransactionSupportString( ConnectorConstants.XA_TRANSACTION_TX_SUPPORT_STRING ); } return ConnectionPoolObjectsUtils.parseTransactionSupportString( ConnectorConstants.LOCAL_TRANSACTION_TX_SUPPORT_STRING); }
userPassword[0] = ConnectionPoolObjectsUtils.getValueFromMCF( "UserName", poolInfo, mcf); userPassword[1] = ConnectionPoolObjectsUtils.getValueFromMCF( "Password", poolInfo, mcf);
final Subject defaultSubject = ConnectionPoolObjectsUtils.createSubject(mcf, resourcePrincipal);
if (ConnectionPoolObjectsUtils.isPoolSystemPool(domainCcp)) { this.redeployResource(resource); return;
public static int getTransactionSupportFromRaXml(String rarName) throws ConnectorRuntimeException { String txSupport = ConnectorRuntime.getRuntime().getConnectorDescriptor(rarName). getOutboundResourceAdapter().getTransSupport(); return parseTransactionSupportString(txSupport); } }