public final DataSource getUnModifiableInstance() throws ValidateException { return new DataSourceImpl(connectionUrl, driverClass, dataSourceClass, driver, transactionIsolation, connectionProperties, timeOut, security, statement, validation, urlDelimiter, urlSelectorStrategyClassName, newConnectionSql, useJavaContext, poolName, enabled, jndiName, spy, useCcm, jta, connectable, tracking, mcp, enlistmentTrace, pool); } }
public final XaDataSource getUnModifiableInstance() throws ValidateException { return new XADataSourceImpl(transactionIsolation, timeOut, security, statement, validation, urlDelimiter, urlProperty, urlSelectorStrategyClassName, useJavaContext, poolName, enabled, jndiName, spy, useCcm, connectable, tracking, mcp, enlistmentTrace, xaDataSourceProperty, xaDataSourceClass, driver, newConnectionSql, getXaPool(), recovery); } }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((connectionProperties == null) ? 0 : connectionProperties.hashCode()); result = prime * result + ((connectionUrl == null) ? 0 : connectionUrl.hashCode()); result = prime * result + ((driver == null) ? 0 : driver.hashCode()); result = prime * result + ((driverClass == null) ? 0 : driverClass.hashCode()); result = prime * result + ((dataSourceClass == null) ? 0 : dataSourceClass.hashCode()); result = prime * result + ((newConnectionSql == null) ? 0 : newConnectionSql.hashCode()); result = prime * result + ((pool == null) ? 0 : pool.hashCode()); return result; }
final Extension connectionListener = ModelNodeUtil.extractExtension(operationContext, dataSourceNode, CONNECTION_LISTENER_CLASS, CONNECTION_LISTENER_PROPERTIES); final DsPool pool = new DsPoolImpl(minPoolSize, initialPoolSize, maxPoolSize, prefill, useStrictMin, flushStrategy, allowMultipleUsers, capacity, fair, connectionListener); final String trackStatementsString = ModelNodeUtil.getResolvedStringIfSetOrGetDefault(operationContext, dataSourceNode, TRACK_STATEMENTS); final Statement.TrackStatementsEnum trackStatements = Statement.TrackStatementsEnum.valueOf(trackStatementsString.toUpperCase(Locale.ENGLISH)); final Statement statement = new StatementImpl(sharePreparedStatements, preparedStatementsCacheSize, trackStatements); final Long useTryLock = ModelNodeUtil.getLongIfSetOrGetDefault(operationContext, dataSourceNode, USE_TRY_LOCK); final boolean setTxQueryTimeout = ModelNodeUtil.getBooleanIfSetOrGetDefault(operationContext, dataSourceNode, SET_TX_QUERY_TIMEOUT); final TimeOut timeOut = new TimeOutImpl(blockingTimeoutMillis, idleTimeoutMinutes, allocationRetry, allocationRetryWaitMillis, xaResourceTimeout, setTxQueryTimeout, queryTimeout, useTryLock); final String transactionIsolationString = ModelNodeUtil.getResolvedStringIfSetOrGetDefault(operationContext, dataSourceNode, TRANSACTION_ISOLATION); final boolean useCcm = ModelNodeUtil.getBooleanIfSetOrGetDefault(operationContext, dataSourceNode, USE_CCM); final Validation validation = new ValidationImpl(backgroundValidation, backgroundValidationMillis, useFastFail, validConnectionChecker, checkValidConnectionSql, validateOnMatch, staleConnectionChecker, exceptionSorter);
final Extension connectionListener = ModelNodeUtil.extractExtension(operationContext, dataSourceNode, CONNECTION_LISTENER_CLASS, CONNECTION_LISTENER_PROPERTIES); final DsXaPool xaPool = new DsXaPoolImpl(minPoolSize, initialPoolSize, maxPoolSize, prefill, useStrictMin, flushStrategy, isSameRmOverride, interleaving, padXid, wrapXaDataSource, noTxSeparatePool, allowMultipleUsers, capacity, fair, connectionListener); final String trackStatementsString = ModelNodeUtil.getResolvedStringIfSetOrGetDefault(operationContext, dataSourceNode, TRACK_STATEMENTS); final Statement.TrackStatementsEnum trackStatements = Statement.TrackStatementsEnum.valueOf(trackStatementsString.toUpperCase(Locale.ENGLISH)); final Statement statement = new StatementImpl(sharePreparedStatements, preparedStatementsCacheSize, trackStatements); final Long useTryLock = ModelNodeUtil.getLongIfSetOrGetDefault(operationContext, dataSourceNode, USE_TRY_LOCK); final Boolean setTxQueryTimeout = ModelNodeUtil.getBooleanIfSetOrGetDefault(operationContext, dataSourceNode, SET_TX_QUERY_TIMEOUT); final TimeOut timeOut = new TimeOutImpl(blockingTimeoutMillis, idleTimeoutMinutes, allocationRetry, allocationRetryWaitMillis, xaResourceTimeout, setTxQueryTimeout, queryTimeout, useTryLock); final String transactionIsolationString = ModelNodeUtil.getResolvedStringIfSetOrGetDefault(operationContext, dataSourceNode, TRANSACTION_ISOLATION); final Boolean spy = ModelNodeUtil.getBooleanIfSetOrGetDefault(operationContext, dataSourceNode, SPY); final Boolean useCcm = ModelNodeUtil.getBooleanIfSetOrGetDefault(operationContext, dataSourceNode, USE_CCM); final Validation validation = new ValidationImpl(backgroundValidation, backgroundValidationMillis, useFastFail, validConnectionChecker, checkValidConnectionSql, validateOnMatch, staleConnectionChecker, exceptionSorter);
String moduleName = installedDriver.getModuleName() != null ? installedDriver.getModuleName().getName() : null; org.jboss.jca.common.api.metadata.ds.Driver driver = new DriverImpl(installedDriver.getDriverName(), installedDriver.getMajorVersion(), installedDriver.getMinorVersion(), moduleName, installedDriver.getDriverClassName(), drivers.put(driverName, driver); dataSources = new DatasourcesImpl(Arrays.asList(dataSourceConfig), null, drivers); } else if (xaDataSourceConfig != null) { String xaDSClsName = xaDataSourceConfig.getXaDataSourceClass(); String moduleName = installedDriver.getModuleName() != null ? installedDriver.getModuleName().getName() : null; org.jboss.jca.common.api.metadata.ds.Driver driver = new DriverImpl(installedDriver.getDriverName(), installedDriver.getMajorVersion(), installedDriver.getMinorVersion(), moduleName, installedDriver.getDriverClassName(), drivers.put(driverName, driver); dataSources = new DatasourcesImpl(null, Arrays.asList(xaDataSourceConfig), drivers);
final DsXaPoolImpl xaPool = new DsXaPoolImpl(minPoolSize < 0 ? Defaults.MIN_POOL_SIZE : Integer.valueOf(minPoolSize), initialPoolSize < 0 ? Defaults.INITIAL_POOL_SIZE : Integer.valueOf(initialPoolSize), maxPoolSize < 1 ? Defaults.MAX_POOL_SIZE : Integer.valueOf(maxPoolSize), startDataSource(xds, bindInfo, eeModuleDescription, context, phaseContext.getServiceTarget(), serviceBuilder, injector); } else { final DsPoolImpl commonPool = new DsPoolImpl(minPoolSize < 0 ? Defaults.MIN_POOL_SIZE : Integer.valueOf(minPoolSize), initialPoolSize < 0 ? Defaults.INITIAL_POOL_SIZE : Integer.valueOf(initialPoolSize), maxPoolSize < 1 ? Defaults.MAX_POOL_SIZE : Integer.valueOf(maxPoolSize),
if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof ModifiableDataSource))
@Override public Validation getValidationFor(Map<String, Object> config) throws Exception { Boolean backgroundValidation = false; Long backgroundValidationMillis = 0L; Boolean useFastFail = false; Extension validConnectionChecker = new Extension( "org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker", null ); String checkValidConnectionSql = null; Boolean validateOnMatch = false; Extension staleConnectionChecker = null; Extension exceptionSorter = new Extension( "org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter", null ); return new ValidationImpl( backgroundValidation, backgroundValidationMillis, useFastFail, validConnectionChecker, checkValidConnectionSql, validateOnMatch, staleConnectionChecker, exceptionSorter ); }
private ModifiableXaDataSource buildXaDataSource(XaDataSource xads) throws org.jboss.jca.common.api.validator.ValidateException { final DsXaPool xaPool; if (xads.getXaPool() == null) { xaPool = new DsXaPoolImpl(Defaults.MIN_POOL_SIZE, Defaults.INITIAL_POOL_SIZE, Defaults.MAX_POOL_SIZE, Defaults.PREFILL, Defaults.USE_STRICT_MIN, Defaults.FLUSH_STRATEGY, Defaults.IS_SAME_RM_OVERRIDE, Defaults.INTERLEAVING, Defaults.PAD_XID, Defaults.WRAP_XA_RESOURCE, Defaults.NO_TX_SEPARATE_POOL, Defaults.ALLOW_MULTIPLE_USERS, null, Defaults.FAIR, null); } else { final DsXaPool p = xads.getXaPool(); xaPool = new DsXaPoolImpl(getDef(p.getMinPoolSize(), Defaults.MIN_POOL_SIZE), getDef(p.getInitialPoolSize(), Defaults.INITIAL_POOL_SIZE), getDef(p.getMaxPoolSize(), Defaults.MAX_POOL_SIZE), getDef(p.isPrefill(), Defaults.PREFILL), getDef(p.isUseStrictMin(), Defaults.USE_STRICT_MIN), getDef(p.getFlushStrategy(), Defaults.FLUSH_STRATEGY), getDef(p.isSameRmOverride(), Defaults.IS_SAME_RM_OVERRIDE), getDef(p.isInterleaving(), Defaults.INTERLEAVING), getDef(p.isPadXid(), Defaults.PAD_XID) , getDef(p.isWrapXaResource(), Defaults.WRAP_XA_RESOURCE), getDef(p.isNoTxSeparatePool(), Defaults.NO_TX_SEPARATE_POOL), getDef(p.isAllowMultipleUsers(), Defaults.ALLOW_MULTIPLE_USERS), p.getCapacity(), getDef(p.isFair(), Defaults.FAIR), p.getConnectionListener()); } return new ModifiableXaDataSource(xads.getTransactionIsolation(), xads.getTimeOut(), xads.getSecurity(), xads.getStatement(), xads.getValidation(), xads.getUrlDelimiter(), xads.getUrlProperty(), xads.getUrlSelectorStrategyClassName(), xads.isUseJavaContext(), xads.getPoolName(), xads.isEnabled(), xads.getJndiName(), xads.isSpy(), xads.isUseCcm(), xads.isConnectable(), xads.isTracking(), xads.getMcp(), xads.isEnlistmentTrace(), xads.getXaDataSourceProperty(), xads.getXaDataSourceClass(), xads.getDriver(), xads.getNewConnectionSql(), xaPool, xads.getRecovery()); }
public DsSecurity getSecurityFor(Map<String, Object> config) throws Exception { return new DsSecurityImpl( (String) config.get( "username" ), (String) config.get( "password" ), null, null ); }
/** * Create a new StatementImpl. * * @param sharePreparedStatements sharePreparedStatements * @param preparedStatementsCacheSize preparedStatementsCacheSize * @param trackStatements trackStatements * @throws ValidateException ValidateException */ public StatementImpl(Boolean sharePreparedStatements, Long preparedStatementsCacheSize, TrackStatementsEnum trackStatements) throws ValidateException { super(); this.sharePreparedStatements = sharePreparedStatements; this.preparedStatementsCacheSize = preparedStatementsCacheSize; this.trackStatements = trackStatements; this.validate(); }
/** * Create a new ValidationImpl. * * @param backgroundValidation backgroundValidation * @param backgroundValidationMillis backgroundValidationMillis * @param useFastFail useFastFail * @param validConnectionChecker validConnectionChecker * @param checkValidConnectionSql checkValidConnectionSql * @param validateOnMatch validateOnMatch * @param staleConnectionChecker staleConnectionChecker * @param exceptionSorter exceptionSorter * @throws ValidateException ValidateException */ public ValidationImpl(Boolean backgroundValidation, Long backgroundValidationMillis, Boolean useFastFail, Extension validConnectionChecker, String checkValidConnectionSql, Boolean validateOnMatch, Extension staleConnectionChecker, Extension exceptionSorter) throws ValidateException { super(validateOnMatch, backgroundValidation, backgroundValidationMillis, useFastFail); this.validConnectionChecker = validConnectionChecker; this.checkValidConnectionSql = checkValidConnectionSql; this.staleConnectionChecker = staleConnectionChecker; this.exceptionSorter = exceptionSorter; this.validate(); }
/** * Create a new TimeOutImpl. * * @param blockingTimeoutMillis blockingTimeoutMillis * @param idleTimeoutMinutes idleTimeoutMinutes * @param allocationRetry allocationRetry * @param allocationRetryWaitMillis allocationRetryWaitMillis * @param xaResourceTimeout xaResourceTimeout * @param setTxQueryTimeout setTxQueryTimeout * @param queryTimeout queryTimeout * @param useTryLock useTryLock * @throws ValidateException ValidateException */ public TimeOutImpl(Long blockingTimeoutMillis, Long idleTimeoutMinutes, Integer allocationRetry, Long allocationRetryWaitMillis, Integer xaResourceTimeout, Boolean setTxQueryTimeout, Long queryTimeout, Long useTryLock) throws ValidateException { super(blockingTimeoutMillis, idleTimeoutMinutes, allocationRetry, allocationRetryWaitMillis, xaResourceTimeout); this.setTxQueryTimeout = setTxQueryTimeout; this.queryTimeout = queryTimeout; this.useTryLock = useTryLock; this.validate(); }
/** * Create a new DriverImpl. * * @param name name * @param majorVersion majorVersion * @param minorVersion minorVersion * @param module module * @param driverClass driverClass * @param dataSourceClass xaDataSourceClass * @param xaDataSourceClass xaDataSourceClass * @throws ValidateException in case name is not specified */ public DriverImpl(String name, Integer majorVersion, Integer minorVersion, String module, String driverClass, String dataSourceClass, String xaDataSourceClass) throws ValidateException { super(); this.name = name; this.majorVersion = majorVersion; this.minorVersion = minorVersion; this.module = module; this.driverClass = driverClass; this.dataSourceClass = dataSourceClass; this.xaDataSourceClass = xaDataSourceClass; this.validate(); }
/** * * Static method to get enum instance given localName string * * @param localName a string used as localname (typically tag name as defined in xsd) * @return the enum instance */ public static Tag forName(String localName) { final Tag element = MAP.get(localName); return element == null ? UNKNOWN.value(localName) : element; } }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((driver == null) ? 0 : driver.hashCode()); result = prime * result + ((newConnectionSql == null) ? 0 : newConnectionSql.hashCode()); result = prime * result + ((xaDataSourceClass == null) ? 0 : xaDataSourceClass.hashCode()); result = prime * result + ((xaDataSourceProperty == null) ? 0 : xaDataSourceProperty.hashCode()); result = prime * result + ((xaPool == null) ? 0 : xaPool.hashCode()); return result; }
public final DataSource getUnModifiableInstance() throws ValidateException { return new DataSourceImpl(connectionUrl, driverClass, dataSourceClass, driver, transactionIsolation, connectionProperties, timeOut, security, statement, validation, urlDelimiter, urlSelectorStrategyClassName, newConnectionSql, useJavaContext, poolName, enabled, jndiName, spy, useCcm, jta, connectable, tracking, mcp, enlistmentTrace, pool); } }
public final XaDataSource getUnModifiableInstance() throws ValidateException { return new XADataSourceImpl(transactionIsolation, timeOut, security, statement, validation, urlDelimiter, urlProperty, urlSelectorStrategyClassName, useJavaContext, poolName, enabled, jndiName, spy, useCcm, connectable, tracking, mcp, enlistmentTrace, xaDataSourceProperty, xaDataSourceClass, driver, newConnectionSql, getXaPool(), recovery); } }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((connectionProperties == null) ? 0 : connectionProperties.hashCode()); result = prime * result + ((connectionUrl == null) ? 0 : connectionUrl.hashCode()); result = prime * result + ((driver == null) ? 0 : driver.hashCode()); result = prime * result + ((driverClass == null) ? 0 : driverClass.hashCode()); result = prime * result + ((dataSourceClass == null) ? 0 : dataSourceClass.hashCode()); result = prime * result + ((newConnectionSql == null) ? 0 : newConnectionSql.hashCode()); result = prime * result + ((pool == null) ? 0 : pool.hashCode()); return result; }