Search in sources :

Example 1 with ConnectionDefinitionImpl

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);
}
Also used : Validation(org.jboss.jca.common.api.metadata.common.Validation) TimeOut(org.jboss.jca.common.api.metadata.common.TimeOut) XaPoolImpl(org.jboss.jca.common.metadata.common.XaPoolImpl) PoolImpl(org.jboss.jca.common.metadata.common.PoolImpl) Security(org.jboss.jca.common.api.metadata.common.Security) Recovery(org.jboss.jca.common.api.metadata.common.Recovery) ValidationImpl(org.jboss.jca.common.metadata.common.ValidationImpl) SecurityImpl(org.jboss.as.connector.metadata.common.SecurityImpl) CredentialImpl(org.jboss.as.connector.metadata.common.CredentialImpl) FlushStrategy(org.jboss.jca.common.api.metadata.common.FlushStrategy) ConnectionDefinitionImpl(org.jboss.jca.common.metadata.resourceadapter.ConnectionDefinitionImpl) XaPoolImpl(org.jboss.jca.common.metadata.common.XaPoolImpl) Pool(org.jboss.jca.common.api.metadata.common.Pool) TimeOutImpl(org.jboss.jca.common.metadata.common.TimeOutImpl)

Example 2 with ConnectionDefinitionImpl

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);
}
Also used : Validation(org.jboss.jca.common.api.metadata.common.Validation) TimeOut(org.jboss.jca.common.api.metadata.common.TimeOut) XaPoolImpl(org.jboss.jca.common.metadata.common.XaPoolImpl) PoolImpl(org.jboss.jca.common.metadata.common.PoolImpl) Security(org.jboss.jca.common.api.metadata.common.Security) Recovery(org.jboss.jca.common.api.metadata.common.Recovery) ValidationImpl(org.jboss.jca.common.metadata.common.ValidationImpl) SecurityImpl(org.jboss.as.connector.metadata.common.SecurityImpl) CredentialImpl(org.jboss.as.connector.metadata.common.CredentialImpl) FlushStrategy(org.jboss.jca.common.api.metadata.common.FlushStrategy) ConnectionDefinitionImpl(org.jboss.jca.common.metadata.resourceadapter.ConnectionDefinitionImpl) XaPoolImpl(org.jboss.jca.common.metadata.common.XaPoolImpl) Pool(org.jboss.jca.common.api.metadata.common.Pool) TimeOutImpl(org.jboss.jca.common.metadata.common.TimeOutImpl)

Aggregations

CredentialImpl (org.jboss.as.connector.metadata.common.CredentialImpl)2 SecurityImpl (org.jboss.as.connector.metadata.common.SecurityImpl)2 FlushStrategy (org.jboss.jca.common.api.metadata.common.FlushStrategy)2 Pool (org.jboss.jca.common.api.metadata.common.Pool)2 Recovery (org.jboss.jca.common.api.metadata.common.Recovery)2 Security (org.jboss.jca.common.api.metadata.common.Security)2 TimeOut (org.jboss.jca.common.api.metadata.common.TimeOut)2 Validation (org.jboss.jca.common.api.metadata.common.Validation)2 PoolImpl (org.jboss.jca.common.metadata.common.PoolImpl)2 TimeOutImpl (org.jboss.jca.common.metadata.common.TimeOutImpl)2 ValidationImpl (org.jboss.jca.common.metadata.common.ValidationImpl)2 XaPoolImpl (org.jboss.jca.common.metadata.common.XaPoolImpl)2 ConnectionDefinitionImpl (org.jboss.jca.common.metadata.resourceadapter.ConnectionDefinitionImpl)2