use of org.jboss.jca.common.metadata.resourceadapter.ConnectionDefinitionImpl in project wildfly by wildfly.
the class ExternalPooledConnectionFactoryService method createConnDef.
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);
}
use of org.jboss.jca.common.metadata.resourceadapter.ConnectionDefinitionImpl in project wildfly by wildfly.
the class PooledConnectionFactoryService method createConnDef.
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);
}
Aggregations