Package org.jboss.jca.common.api.metadata.ds

Examples of org.jboss.jca.common.api.metadata.ds.TimeOut


   private XaDataSource parseXADataSource(XMLStreamReader reader) throws XMLStreamException, ParserException,
      ValidateException
   {
      TransactionIsolation transactionIsolation = null;
      Map<String, String> xaDataSourceProperty = new HashMap<String, String>();
      TimeOut timeOutSettings = null;
      DsSecurity securitySettings = null;
      Statement statementSettings = null;
      Validation validationSettings = null;
      String urlDelimiter = null;
      String urlSelectorStrategyClassName = null;
View Full Code Here


      String connectionUrl = null;
      String driverClass = null;
      String driver = null;
      TransactionIsolation transactionIsolation = null;
      Map<String, String> connectionProperties = new HashMap<String, String>();
      TimeOut timeOutSettings = null;
      DsSecurity securitySettings = null;
      Statement statementSettings = null;
      Validation validationSettings = null;
      String urlDelimiter = null;
      String urlSelectorStrategyClassName = null;
View Full Code Here

   parseXADataSource(XMLStreamReader reader) throws XMLStreamException, ParserException,
      ValidateException
   {
      TransactionIsolation transactionIsolation = null;
      Map<String, String> xaDataSourceProperty = new HashMap<String, String>();
      TimeOut timeOutSettings = null;
      DsSecurity securitySettings = null;
      Statement statementSettings = null;
      Validation validationSettings = null;
      String urlDelimiter = null;
      String urlSelectorStrategyClassName = null;
View Full Code Here

      String driverClass = null;
      String dataSourceClass = null;
      String driver = null;
      TransactionIsolation transactionIsolation = null;
      Map<String, String> connectionProperties = new HashMap<String, String>();
      TimeOut timeOutSettings = null;
      DsSecurity securitySettings = null;
      Statement statementSettings = null;
      Validation validationSettings = null;
      String urlDelimiter = null;
      String urlSelectorStrategyClassName = null;
View Full Code Here

   parseXADataSource(XMLStreamReader reader) throws XMLStreamException, ParserException,
      ValidateException
   {
      TransactionIsolation transactionIsolation = null;
      Map<String, String> xaDataSourceProperty = new HashMap<String, String>();
      TimeOut timeOutSettings = null;
      DsSecurity securitySettings = null;
      Statement statementSettings = null;
      Validation validationSettings = null;
      String urlDelimiter = null;
      String urlSelectorStrategyClassName = null;
View Full Code Here

      String driverClass = null;
      String dataSourceClass = null;
      String driver = null;
      TransactionIsolation transactionIsolation = null;
      Map<String, String> connectionProperties = new HashMap<String, String>();
      TimeOut timeOutSettings = null;
      DsSecurity securitySettings = null;
      Statement statementSettings = null;
      Validation validationSettings = null;
      String urlDelimiter = null;
      String urlSelectorStrategyClassName = null;
View Full Code Here

            if (security.getPassword() != null) {
                xaManagedConnectionFactory.setPassword(security.getPassword());
            }
        }

        final TimeOut timeOut = dataSourceConfig.getTimeOut();
        if (timeOut != null) {
            if (timeOut.getUseTryLock() != null) {
                xaManagedConnectionFactory.setUseTryLock(timeOut.getUseTryLock().intValue());
            }
            if (timeOut.getQueryTimeout() != null) {
                xaManagedConnectionFactory.setQueryTimeout(timeOut.getQueryTimeout().intValue());
            }
        }

        final Statement statement = dataSourceConfig.getStatement();
        if (statement != null) {
View Full Code Here

            if (security.getPassword() != null) {
                managedConnectionFactory.setPassword(security.getPassword());
            }
        }

        final TimeOut timeOut = dataSourceConfig.getTimeOut();
        if (timeOut != null) {
            if (timeOut.getUseTryLock() != null) {
                managedConnectionFactory.setUseTryLock(timeOut.getUseTryLock().intValue());
            }
            if (timeOut.getQueryTimeout() != null) {
                managedConnectionFactory.setQueryTimeout(timeOut.getQueryTimeout().intValue());
            }
        }

        final Statement statement = dataSourceConfig.getStatement();
        if (statement != null) {
View Full Code Here

                        setIfNotNull(dsModel, SHAREPREPAREDSTATEMENTS, statement.isSharePreparedStatements());
                        if (statement.getTrackStatements() != null) {
                            setIfNotNull(dsModel, TRACKSTATEMENTS, statement.getTrackStatements().name());
                        }
                    }
                    TimeOut timeout = ds.getTimeOut();
                    if (timeout != null) {
                        setIfNotNull(dsModel, ALLOCATION_RETRY, timeout.getAllocationRetry());
                        setIfNotNull(dsModel, ALLOCATION_RETRY_WAIT_MILLIS, timeout.getAllocationRetryWaitMillis());
                        setIfNotNull(dsModel, BLOCKING_TIMEOUT_WAIT_MILLIS, timeout.getBlockingTimeoutMillis());
                        setIfNotNull(dsModel, IDLETIMEOUTMINUTES, timeout.getIdleTimeoutMinutes());
                        setIfNotNull(dsModel, QUERYTIMEOUT, timeout.getQueryTimeout());
                        setIfNotNull(dsModel, USETRYLOCK, timeout.getUseTryLock());
                        setIfNotNull(dsModel, SETTXQUERYTIMEOUT, timeout.isSetTxQueryTimeout());
                    }
                    if (ds.getTransactionIsolation() != null) {
                        setIfNotNull(dsModel, TRANSACTION_ISOLOATION, ds.getTransactionIsolation().name());
                    }

                    if (ds.isSpy()) {
                        setIfNotNull(dsModel, SPY, ds.isSpy());
                    }

                    Validation validation = ds.getValidation();
                    if (validation != null) {
                        setIfNotNull(dsModel, CHECKVALIDCONNECTIONSQL, validation.getCheckValidConnectionSql());
                        setIfNotNull(dsModel, EXCEPTIONSORTERCLASSNAME, EXCEPTIONSORTER_PROPERTIES,
                                validation.getExceptionSorter());
                        setIfNotNull(dsModel, STALECONNECTIONCHECKERCLASSNAME, STALECONNECTIONCHECKER_PROPERTIES,
                                validation.getStaleConnectionChecker());
                        setIfNotNull(dsModel, VALIDCONNECTIONCHECKERCLASSNAME, VALIDCONNECTIONCHECKER_PROPERTIES,
                                validation.getValidConnectionChecker());
                        setIfNotNull(dsModel, BACKGROUNDVALIDATIONMINUTES, validation.getBackgroundValidationMinutes());
                        setIfNotNull(dsModel, BACKGROUNDVALIDATION, validation.isBackgroundValidation());
                        setIfNotNull(dsModel, USE_FAST_FAIL, validation.isUseFastFail());
                        setIfNotNull(dsModel, VALIDATEONMATCH, validation.isValidateOnMatch());
                    }

                    datasourcesNode.add(dsModel);
                }

                ModelNode XAdatasourcesNode = subsystem.get(DATASOURCES);
                for (XaDataSource xads : dataSources.getXaDataSource()) {
                    ModelNode xadsModel = new ModelNode();
                    for (Entry<String, String> entry : xads.getXaDataSourceProperty().entrySet()) {
                        xadsModel.get(XADATASOURCEPROPERTIES, entry.getKey()).set(entry.getValue());
                    }
                    setIfNotNull(xadsModel, XADATASOURCECLASS, xads.getXaDataSourceClass());
                    setIfNotNull(xadsModel, JNDINAME, xads.getJndiName());
                    setIfNotNull(xadsModel, MODULE, xads.getModule());
                    setIfNotNull(xadsModel, NEW_CONNECTION_SQL, xads.getNewConnectionSql());
                    setIfNotNull(xadsModel, POOLNAME, xads.getPoolName());
                    setIfNotNull(xadsModel, URL_DELIMITER, xads.getUrlDelimiter());
                    setIfNotNull(xadsModel, URL_SELECTOR_STRATEGY_CLASS_NAME, xads.getUrlSelectorStrategyClassName());
                    setIfNotNull(xadsModel, USE_JAVA_CONTEXT, xads.isUseJavaContext());
                    setIfNotNull(xadsModel, ENABLED, xads.isEnabled());
                    CommonXaPool pool = xads.getXaPool();
                    if (pool != null) {
                        setIfNotNull(xadsModel, MAX_POOL_SIZE, pool.getMaxPoolSize());
                        setIfNotNull(xadsModel, MIN_POOL_SIZE, pool.getMinPoolSize());
                        setIfNotNull(xadsModel, POOL_PREFILL, pool.isPrefill());
                        setIfNotNull(xadsModel, POOL_USE_STRICT_MIN, pool.isUseStrictMin());
                        setIfNotNull(xadsModel, INTERLIVING, pool.isInterleaving());
                        setIfNotNull(xadsModel, NOTXSEPARATEPOOL, pool.isNoTxSeparatePool());
                        setIfNotNull(xadsModel, PAD_XID, pool.isPadXid());
                        setIfNotNull(xadsModel, SAME_RM_OVERRIDE, pool.isSameRmOverride());
                        setIfNotNull(xadsModel, WRAP_XA_DATASOURCE, pool.isWrapXaDataSource());
                    }
                    DsSecurity security = xads.getSecurity();
                    if (security != null) {
                        setIfNotNull(xadsModel, USERNAME, security.getUserName());
                        setIfNotNull(xadsModel, PASSWORD, security.getPassword());
                        setIfNotNull(xadsModel, SECURITY_DOMAIN, security.getSecurityDomain());
                    }
                    Statement statement = xads.getStatement();
                    if (statement != null) {
                        setIfNotNull(xadsModel, PREPAREDSTATEMENTSCACHESIZE, statement.getPreparedStatementsCacheSize());
                        setIfNotNull(xadsModel, SHAREPREPAREDSTATEMENTS, statement.isSharePreparedStatements());
                        if (statement.getTrackStatements() != null) {
                            setIfNotNull(xadsModel, TRACKSTATEMENTS, statement.getTrackStatements().name());
                        }
                    }
                    TimeOut timeout = xads.getTimeOut();
                    if (timeout != null) {
                        setIfNotNull(xadsModel, ALLOCATION_RETRY, timeout.getAllocationRetry());
                        setIfNotNull(xadsModel, ALLOCATION_RETRY_WAIT_MILLIS, timeout.getAllocationRetryWaitMillis());
                        setIfNotNull(xadsModel, BLOCKING_TIMEOUT_WAIT_MILLIS, timeout.getBlockingTimeoutMillis());
                        setIfNotNull(xadsModel, IDLETIMEOUTMINUTES, timeout.getIdleTimeoutMinutes());
                        setIfNotNull(xadsModel, QUERYTIMEOUT, timeout.getQueryTimeout());
                        setIfNotNull(xadsModel, USETRYLOCK, timeout.getUseTryLock());
                        setIfNotNull(xadsModel, SETTXQUERYTIMEOUT, timeout.isSetTxQueryTimeout());
                        setIfNotNull(xadsModel, XA_RESOURCE_TIMEOUT, timeout.getXaResourceTimeout());
                    }
                    if (xads.getTransactionIsolation() != null) {
                        setIfNotNull(xadsModel, TRANSACTION_ISOLOATION, xads.getTransactionIsolation().name());
                    }
View Full Code Here

                    Long idleTimeoutMinutes = getLongIfSetOrGetDefault(dataSourceNode, IDLETIMEOUTMINUTES, null);
                    Long queryTimeout = getLongIfSetOrGetDefault(dataSourceNode, QUERYTIMEOUT, null);
                    Integer xaResourceTimeout = getIntIfSetOrGetDefault(dataSourceNode, XA_RESOURCE_TIMEOUT, null);
                    Long useTryLock = getLongIfSetOrGetDefault(dataSourceNode, USETRYLOCK, null);
                    boolean setTxQuertTimeout = getBooleanIfSetOrGetDefault(dataSourceNode, SETTXQUERYTIMEOUT, false);
                    TimeOut timeOut = new TimeOutImpl(blockingTimeoutMillis, idleTimeoutMinutes, allocationRetry,
                            allocationRetryWaitMillis, xaResourceTimeout, setTxQuertTimeout, queryTimeout, useTryLock);
                    TransactionIsolation transactionIsolation = dataSourceNode.has(TRANSACTION_ISOLOATION) ? TransactionIsolation
                            .valueOf(dataSourceNode.get(TRANSACTION_ISOLOATION).asString()) : null;
                    String checkValidConnectionSql = getStringIfSetOrGetDefault(dataSourceNode, CHECKVALIDCONNECTIONSQL, null);

                    JdbcAdapterExtension exceptionSorter = extractJdbcAdapterExtension(dataSourceNode,
                            EXCEPTIONSORTERCLASSNAME, EXCEPTIONSORTER_PROPERTIES);
                    JdbcAdapterExtension staleConnectionChecker = extractJdbcAdapterExtension(dataSourceNode,
                            STALECONNECTIONCHECKERCLASSNAME, STALECONNECTIONCHECKER_PROPERTIES);
                    JdbcAdapterExtension validConnectionChecker = extractJdbcAdapterExtension(dataSourceNode,
                            VALIDCONNECTIONCHECKERCLASSNAME, VALIDCONNECTIONCHECKER_PROPERTIES);

                    Long backgroundValidationMinutes = getLongIfSetOrGetDefault(dataSourceNode, BACKGROUNDVALIDATIONMINUTES,
                            null);
                    boolean backgroundValidation = getBooleanIfSetOrGetDefault(dataSourceNode, BACKGROUNDVALIDATION, false);
                    boolean useFastFail = getBooleanIfSetOrGetDefault(dataSourceNode, USE_FAST_FAIL, false);
                    boolean validateOnMatch = getBooleanIfSetOrGetDefault(dataSourceNode, VALIDATEONMATCH, false);
                    boolean spy = getBooleanIfSetOrGetDefault(dataSourceNode, SPY, false);
                    Validation validation = new ValidationImpl(backgroundValidation, backgroundValidationMinutes, useFastFail,
                            validConnectionChecker, checkValidConnectionSql, validateOnMatch, staleConnectionChecker,
                            exceptionSorter);
                    DataSource ds = new DataSourceImpl(connectionUrl, driverClass, module, transactionIsolation,
                            connectionProperties, timeOut, security, statement, validation, urlDelimiter,
                            urlSelectorStrategyClassName, newConnectionSql, useJavaContext, poolName, enabled, jndiName, spy,
                            pool);
                    datasourceList.add(ds);
                }
            }

            if (operation.hasDefined(XA_DATASOURCES)) {
                for (ModelNode dataSourceNode : operation.get(XA_DATASOURCES).asList()) {
                    Map<String, String> xaDataSourceProperty = new HashMap<String, String>(dataSourceNode
                            .get(XADATASOURCEPROPERTIES).asList().size());
                    for (ModelNode property : dataSourceNode.get(XADATASOURCEPROPERTIES).asList()) {
                        xaDataSourceProperty.put(property.asProperty().getName(), property.asString());
                    }
                    String xaDataSourceClass = getStringIfSetOrGetDefault(dataSourceNode, XADATASOURCECLASS, null);
                    String jndiName = getStringIfSetOrGetDefault(dataSourceNode, JNDINAME, null);
                    String module = getStringIfSetOrGetDefault(dataSourceNode, MODULE, null);
                    String newConnectionSql = getStringIfSetOrGetDefault(dataSourceNode, NEW_CONNECTION_SQL, null);
                    String poolName = getStringIfSetOrGetDefault(dataSourceNode, POOLNAME, null);
                    String urlDelimiter = getStringIfSetOrGetDefault(dataSourceNode, URL_DELIMITER, null);
                    String urlSelectorStrategyClassName = getStringIfSetOrGetDefault(dataSourceNode,
                            URL_SELECTOR_STRATEGY_CLASS_NAME, null);
                    boolean useJavaContext = getBooleanIfSetOrGetDefault(dataSourceNode, USE_JAVA_CONTEXT, false);
                    boolean enabled = getBooleanIfSetOrGetDefault(dataSourceNode, ENABLED, false);
                    Integer maxPoolSize = getIntIfSetOrGetDefault(dataSourceNode, MAX_POOL_SIZE, null);
                    Integer minPoolSize = getIntIfSetOrGetDefault(dataSourceNode, MIN_POOL_SIZE, null);
                    boolean prefill = getBooleanIfSetOrGetDefault(dataSourceNode, POOL_PREFILL, false);
                    boolean useStrictMin = getBooleanIfSetOrGetDefault(dataSourceNode, POOL_USE_STRICT_MIN, false);
                    boolean interleaving = getBooleanIfSetOrGetDefault(dataSourceNode, INTERLIVING, false);
                    boolean noTxSeparatePool = getBooleanIfSetOrGetDefault(dataSourceNode, NOTXSEPARATEPOOL, false);
                    boolean padXid = getBooleanIfSetOrGetDefault(dataSourceNode, PAD_XID, false);
                    boolean isSameRmOverride = getBooleanIfSetOrGetDefault(dataSourceNode, SAME_RM_OVERRIDE, false);
                    boolean wrapXaDataSource = getBooleanIfSetOrGetDefault(dataSourceNode, WRAP_XA_DATASOURCE, false);
                    CommonXaPool xaPool = new CommonXaPoolImpl(minPoolSize, maxPoolSize, prefill, useStrictMin,
                            isSameRmOverride, interleaving, padXid, wrapXaDataSource, noTxSeparatePool);

                    String username = getStringIfSetOrGetDefault(dataSourceNode, USERNAME, null);
                    String password = getStringIfSetOrGetDefault(dataSourceNode, PASSWORD, null);
                    String securityDomain = getStringIfSetOrGetDefault(dataSourceNode, SECURITY_DOMAIN, null);

                    DsSecurity security = new DsSecurityImpl(username, password, securityDomain);

                    boolean sharePreparedStatements = dataSourceNode.has(SHAREPREPAREDSTATEMENTS) ? dataSourceNode.get(
                            SHAREPREPAREDSTATEMENTS).asBoolean() : false;
                    Long preparedStatementsCacheSize = dataSourceNode.get(PREPAREDSTATEMENTSCACHESIZE).asLong();
                    TrackStatementsEnum trackStatements = TrackStatementsEnum.valueOf(dataSourceNode.get(TRACKSTATEMENTS)
                            .asString());
                    Statement statement = new StatementImpl(sharePreparedStatements, preparedStatementsCacheSize,
                            trackStatements);

                    Integer allocationRetry = getIntIfSetOrGetDefault(dataSourceNode, ALLOCATION_RETRY, null);
                    Long allocationRetryWaitMillis = getLongIfSetOrGetDefault(dataSourceNode, ALLOCATION_RETRY_WAIT_MILLIS,
                            null);
                    Long blockingTimeoutMillis = getLongIfSetOrGetDefault(dataSourceNode, BLOCKING_TIMEOUT_WAIT_MILLIS, null);
                    Long idleTimeoutMinutes = getLongIfSetOrGetDefault(dataSourceNode, IDLETIMEOUTMINUTES, null);
                    Long queryTimeout = getLongIfSetOrGetDefault(dataSourceNode, QUERYTIMEOUT, null);
                    Integer xaResourceTimeout = getIntIfSetOrGetDefault(dataSourceNode, XA_RESOURCE_TIMEOUT, null);
                    Long useTryLock = getLongIfSetOrGetDefault(dataSourceNode, USETRYLOCK, null);
                    boolean setTxQuertTimeout = getBooleanIfSetOrGetDefault(dataSourceNode, SETTXQUERYTIMEOUT, false);
                    TimeOut timeOut = new TimeOutImpl(blockingTimeoutMillis, idleTimeoutMinutes, allocationRetry,
                            allocationRetryWaitMillis, xaResourceTimeout, setTxQuertTimeout, queryTimeout, useTryLock);
                    TransactionIsolation transactionIsolation = dataSourceNode.has(TRANSACTION_ISOLOATION) ? TransactionIsolation
                            .valueOf(dataSourceNode.get(TRANSACTION_ISOLOATION).asString()) : null;
                    String checkValidConnectionSql = getStringIfSetOrGetDefault(dataSourceNode, CHECKVALIDCONNECTIONSQL, null);
View Full Code Here

TOP

Related Classes of org.jboss.jca.common.api.metadata.ds.TimeOut

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.