boolean useFastFail = ModelNodeUtil.getBooleanIfSetOrGetDefault(context, connDefModel, USE_FAST_FAIL); final Boolean validateOnMatch = ModelNodeUtil.getBooleanIfSetOrGetDefault(context, connDefModel, VALIDATE_ON_MATCH ); Validation validation = new ValidationImpl(validateOnMatch, backgroundValidation, backgroundValidationMillis, useFastFail);
/** * Constructor * * @param validateOnMatch validateOnMatch * @param backgroundValidation backgroundValidation * @param backgroundValidationMillis backgroundValidationMillis * @param useFastFail useFastFail * @throws ValidateException in case of error */ public ValidationImpl(Boolean validateOnMatch, Boolean backgroundValidation, Long backgroundValidationMillis, Boolean useFastFail) throws ValidateException { this.validateOnMatch = validateOnMatch; this.backgroundValidation = backgroundValidation; this.backgroundValidationMillis = backgroundValidationMillis; this.useFastFail = useFastFail; partialCommonValidate(); }
/** * {@inheritDoc} */ public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((checkValidConnectionSql == null) ? 0 : checkValidConnectionSql.hashCode()); result = prime * result + ((exceptionSorter == null) ? 0 : exceptionSorter.hashCode()); result = prime * result + ((staleConnectionChecker == null) ? 0 : staleConnectionChecker.hashCode()); result = prime * result + ((validConnectionChecker == null) ? 0 : validConnectionChecker.hashCode()); return result; }
if (!super.equals(obj)) return false; if (!(obj instanceof ValidationImpl))
if (ConnectionDefinition.Tag.forName(reader.getLocalName()) == ConnectionDefinition.Tag.VALIDATION) return new ValidationImpl(validateOnMatch, backgroundValidation, backgroundValidationMillis, useFastFail);
private static ConnectionDefinition createConnDef(TransactionSupportEnum transactionSupport, String jndiName, int minPoolSize, int maxPoolSize, String managedConnectionPoolClassName, Boolean enlistmentTrace) throws ValidateException { Integer minSize = (minPoolSize == -1) ? null : minPoolSize; Integer maxSize = (maxPoolSize == -1) ? null : maxPoolSize; boolean prefill = false; boolean useStrictMin = false; FlushStrategy flushStrategy = FlushStrategy.FAILING_CONNECTION_ONLY; Boolean isXA = Boolean.FALSE; final Pool pool; if (transactionSupport == TransactionSupportEnum.XATransaction) { pool = new XaPoolImpl(minSize, Defaults.INITIAL_POOL_SIZE, maxSize, prefill, useStrictMin, flushStrategy, null, Defaults.FAIR, Defaults.IS_SAME_RM_OVERRIDE, Defaults.INTERLEAVING, Defaults.PAD_XID, Defaults.WRAP_XA_RESOURCE, Defaults.NO_TX_SEPARATE_POOL); isXA = Boolean.TRUE; } else { pool = new PoolImpl(minSize, Defaults.INITIAL_POOL_SIZE, maxSize, prefill, useStrictMin, flushStrategy, null, Defaults.FAIR); } TimeOut timeOut = new TimeOutImpl(null, null, null, null, null) { }; // <security> // <application /> // </security> // => PoolStrategy.POOL_BY_CRI Security security = new SecurityImpl(null, null, true, false); // register the XA Connection *without* recovery. ActiveMQ already takes care of the registration with the correct credentials // when its ResourceAdapter is started Recovery recovery = new Recovery(new CredentialImpl(null, null, null, false, null), null, Boolean.TRUE); Validation validation = new ValidationImpl(Defaults.VALIDATE_ON_MATCH, null, null, false); // do no track return new ConnectionDefinitionImpl(Collections.<String, String>emptyMap(), RAMANAGED_CONN_FACTORY, jndiName, ACTIVEMQ_CONN_DEF, true, true, true, Defaults.SHARABLE, Defaults.ENLISTMENT, Defaults.CONNECTABLE, false, managedConnectionPoolClassName, enlistmentTrace, pool, timeOut, validation, security, recovery, isXA); }
private static ConnectionDefinition createConnDef(TransactionSupportEnum transactionSupport, String jndiName, int minPoolSize, int maxPoolSize, String managedConnectionPoolClassName, Boolean enlistmentTrace) throws ValidateException { Integer minSize = (minPoolSize == -1) ? null : minPoolSize; Integer maxSize = (maxPoolSize == -1) ? null : maxPoolSize; boolean prefill = false; boolean useStrictMin = false; FlushStrategy flushStrategy = FlushStrategy.FAILING_CONNECTION_ONLY; Boolean isXA = Boolean.FALSE; final Pool pool; if (transactionSupport == TransactionSupportEnum.XATransaction) { pool = new XaPoolImpl(minSize, Defaults.INITIAL_POOL_SIZE, maxSize, prefill, useStrictMin, flushStrategy, null, Defaults.FAIR, Defaults.IS_SAME_RM_OVERRIDE, Defaults.INTERLEAVING, Defaults.PAD_XID, Defaults.WRAP_XA_RESOURCE, Defaults.NO_TX_SEPARATE_POOL); isXA = Boolean.TRUE; } else { pool = new PoolImpl(minSize, Defaults.INITIAL_POOL_SIZE, maxSize, prefill, useStrictMin, flushStrategy, null, Defaults.FAIR); } TimeOut timeOut = new TimeOutImpl(null, null, null, null, null) { }; // <security> // <application /> // </security> // => PoolStrategy.POOL_BY_CRI Security security = new SecurityImpl(null, null, true, false); // register the XA Connection *without* recovery. ActiveMQ already takes care of the registration with the correct credentials // when its ResourceAdapter is started Recovery recovery = new Recovery(new CredentialImpl(null, null, null, false, null), null, Boolean.TRUE); Validation validation = new ValidationImpl(Defaults.VALIDATE_ON_MATCH, null, null, false); // do no track return new ConnectionDefinitionImpl(Collections.<String, String>emptyMap(), RAMANAGED_CONN_FACTORY, jndiName, ACTIVEMQ_CONN_DEF, true, true, true, Defaults.SHARABLE, Defaults.ENLISTMENT, Defaults.CONNECTABLE, false, managedConnectionPoolClassName, enlistmentTrace, pool, timeOut, validation, security, recovery, isXA); }
private static ConnectionDefinition createConnDef(TransactionSupportEnum transactionSupport, String jndiName, int minPoolSize, int maxPoolSize, String managedConnectionPoolClassName, Boolean enlistmentTrace) throws ValidateException { Integer minSize = (minPoolSize == -1) ? null : minPoolSize; Integer maxSize = (maxPoolSize == -1) ? null : maxPoolSize; boolean prefill = false; boolean useStrictMin = false; FlushStrategy flushStrategy = FlushStrategy.FAILING_CONNECTION_ONLY; Boolean isXA = Boolean.FALSE; final Pool pool; if (transactionSupport == TransactionSupportEnum.XATransaction) { pool = new XaPoolImpl(minSize, Defaults.INITIAL_POOL_SIZE, maxSize, prefill, useStrictMin, flushStrategy, null, Defaults.FAIR, Defaults.IS_SAME_RM_OVERRIDE, Defaults.INTERLEAVING, Defaults.PAD_XID, Defaults.WRAP_XA_RESOURCE, Defaults.NO_TX_SEPARATE_POOL); isXA = Boolean.TRUE; } else { pool = new PoolImpl(minSize, Defaults.INITIAL_POOL_SIZE, maxSize, prefill, useStrictMin, flushStrategy, null, Defaults.FAIR); } TimeOut timeOut = new TimeOutImpl(null, null, null, null, null) { }; // <security> // <application /> // </security> // => PoolStrategy.POOL_BY_CRI Security security = new SecurityImpl(null, null, true, false); // register the XA Connection *without* recovery. ActiveMQ already takes care of the registration with the correct credentials // when its ResourceAdapter is started Recovery recovery = new Recovery(new CredentialImpl(null, null, null, false, null), null, Boolean.TRUE); Validation validation = new ValidationImpl(Defaults.VALIDATE_ON_MATCH, null, null, false); // do no track return new ConnectionDefinitionImpl(Collections.<String, String>emptyMap(), RAMANAGED_CONN_FACTORY, jndiName, ACTIVEMQ_CONN_DEF, true, true, true, Defaults.SHARABLE, Defaults.ENLISTMENT, Defaults.CONNECTABLE, false, managedConnectionPoolClassName, enlistmentTrace, pool, timeOut, validation, security, recovery, isXA); }
private static ConnectionDefinition createConnDef(TransactionSupportEnum transactionSupport, String jndiName, int minPoolSize, int maxPoolSize, String managedConnectionPoolClassName, Boolean enlistmentTrace) throws ValidateException { Integer minSize = (minPoolSize == -1) ? null : minPoolSize; Integer maxSize = (maxPoolSize == -1) ? null : maxPoolSize; boolean prefill = false; boolean useStrictMin = false; FlushStrategy flushStrategy = FlushStrategy.FAILING_CONNECTION_ONLY; Boolean isXA = Boolean.FALSE; final Pool pool; if (transactionSupport == TransactionSupportEnum.XATransaction) { pool = new XaPoolImpl(minSize, Defaults.INITIAL_POOL_SIZE, maxSize, prefill, useStrictMin, flushStrategy, null, Defaults.FAIR, Defaults.IS_SAME_RM_OVERRIDE, Defaults.INTERLEAVING, Defaults.PAD_XID, Defaults.WRAP_XA_RESOURCE, Defaults.NO_TX_SEPARATE_POOL); isXA = Boolean.TRUE; } else { pool = new PoolImpl(minSize, Defaults.INITIAL_POOL_SIZE, maxSize, prefill, useStrictMin, flushStrategy, null, Defaults.FAIR); } TimeOut timeOut = new TimeOutImpl(null, null, null, null, null) { }; // <security> // <application /> // </security> // => PoolStrategy.POOL_BY_CRI Security security = new SecurityImpl(null, null, true, false); // register the XA Connection *without* recovery. ActiveMQ already takes care of the registration with the correct credentials // when its ResourceAdapter is started Recovery recovery = new Recovery(new CredentialImpl(null, null, null, false, null), null, Boolean.TRUE); Validation validation = new ValidationImpl(Defaults.VALIDATE_ON_MATCH, null, null, false); // do no track return new ConnectionDefinitionImpl(Collections.<String, String>emptyMap(), RAMANAGED_CONN_FACTORY, jndiName, ACTIVEMQ_CONN_DEF, true, true, true, Defaults.SHARABLE, Defaults.ENLISTMENT, Defaults.CONNECTABLE, false, managedConnectionPoolClassName, enlistmentTrace, pool, timeOut, validation, security, recovery, isXA); }
boolean useFastFail = ModelNodeUtil.getBooleanIfSetOrGetDefault(context, connDefModel, USE_FAST_FAIL); final Boolean validateOnMatch = ModelNodeUtil.getBooleanIfSetOrGetDefault(context, connDefModel, VALIDATE_ON_MATCH ); Validation validation = new ValidationImpl(validateOnMatch, backgroundValidation, backgroundValidationMillis, useFastFail);