private void handlePropertyAttribute(final String attributeName, final OperationContext context, final XaDataSource dataSource, final String propName) { if (attributeName.equals(ModelDescriptionConstants.VALUE)) { setStringIfNotNull(context, dataSource.getXaDataSourceProperty().get(propName)); } else { throw ConnectorLogger.ROOT_LOGGER.unknownAttribute(attributeName); } }
private void installManagementModel(final XaDataSource ds, final DeploymentUnit deploymentUnit, final PathAddress addr) { XMLXaDataSourceRuntimeHandler.INSTANCE.registerDataSource(addr, ds); final DeploymentResourceSupport deploymentResourceSupport = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT); deploymentResourceSupport.getDeploymentSubModel(DataSourcesExtension.SUBSYSTEM_NAME, addr.getLastElement()); if (ds.getXaDataSourceProperty() != null) { for (final Map.Entry<String, String> prop : ds.getXaDataSourceProperty().entrySet()) { PathAddress registration = PathAddress.pathAddress(addr.getLastElement(), PathElement.pathElement(XA_CONNECTION_PROPERTIES, prop.getKey())); deploymentResourceSupport.getDeploymentSubModel(DataSourcesExtension.SUBSYSTEM_NAME, registration); } } }
@Override protected ManagedConnectionFactory createMcf(XaDataSource arg0, String arg1, ClassLoader arg2) throws NotFoundException, DeployException { final XAManagedConnectionFactory xaManagedConnectionFactory = new XAManagedConnectionFactory(xaDataSourceConfig.getXaDataSourceProperty()); if (xaDataSourceConfig.getUrlDelimiter() != null) { xaManagedConnectionFactory.setURLDelimiter(xaDataSourceConfig.getUrlDelimiter()); } if (xaDataSourceConfig.getXaDataSourceClass() != null) { xaManagedConnectionFactory.setXADataSourceClass(xaDataSourceConfig.getXaDataSourceClass()); } if (xaDataSourceConfig.getUrlSelectorStrategyClassName() != null) { xaManagedConnectionFactory .setUrlSelectorStrategyClassName(xaDataSourceConfig.getUrlSelectorStrategyClassName()); } if (xaDataSourceConfig.getXaPool() != null && xaDataSourceConfig.getXaPool().isSameRmOverride() != null) { xaManagedConnectionFactory.setIsSameRMOverrideValue(xaDataSourceConfig.getXaPool().isSameRmOverride()); } if (xaDataSourceConfig.getNewConnectionSql() != null) { xaManagedConnectionFactory.setNewConnectionSQL(xaDataSourceConfig.getNewConnectionSql()); } if (xaDataSourceConfig.getUrlSelectorStrategyClassName() != null) { xaManagedConnectionFactory .setUrlSelectorStrategyClassName(xaDataSourceConfig.getUrlSelectorStrategyClassName()); } setMcfProperties(xaManagedConnectionFactory, xaDataSourceConfig, xaDataSourceConfig.getStatement()); return xaManagedConnectionFactory; }
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()); }
private void handlePropertyAttribute(final String attributeName, final OperationContext context, final XaDataSource dataSource, final String propName) { if (attributeName.equals(ModelDescriptionConstants.VALUE)) { setStringIfNotNull(context, dataSource.getXaDataSourceProperty().get(propName)); } else { throw ConnectorLogger.ROOT_LOGGER.unknownAttribute(attributeName); } }
private void handlePropertyAttribute(final String attributeName, final OperationContext context, final XaDataSource dataSource, final String propName) { if (attributeName.equals(ModelDescriptionConstants.VALUE)) { setStringIfNotNull(context, dataSource.getXaDataSourceProperty().get(propName)); } else { throw ConnectorMessages.MESSAGES.unknownAttribute(attributeName); } }
private void installManagementModel(final XaDataSource ds, final DeploymentUnit deploymentUnit, final PathAddress addr) { XMLXaDataSourceRuntimeHandler.INSTANCE.registerDataSource(addr, ds); final DeploymentResourceSupport deploymentResourceSupport = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT); deploymentResourceSupport.getDeploymentSubModel(DataSourcesExtension.SUBSYSTEM_NAME, addr.getLastElement()); if (ds.getXaDataSourceProperty() != null) { for (final Map.Entry<String, String> prop : ds.getXaDataSourceProperty().entrySet()) { PathAddress registration = PathAddress.pathAddress(addr.getLastElement(), PathElement.pathElement(XA_CONNECTION_PROPERTIES, prop.getKey())); deploymentResourceSupport.getDeploymentSubModel(DataSourcesExtension.SUBSYSTEM_NAME, registration); } } }
if (xads != null && xads.getXaDataSourceProperty() != null) for (Entry<String, String> xaConfigProperty : xads.getXaDataSourceProperty().entrySet())
xaManagedConnectionFactory.setXADataSourceClass(xaDataSourceConfig.getXaDataSourceClass()); if (xaDataSourceConfig.getXaDataSourceProperty() != null) { xaManagedConnectionFactory.setXaProps(xaDataSourceConfig.getXaDataSourceProperty());
@Override protected ManagedConnectionFactory createMcf(XaDataSource arg0, String arg1, ClassLoader arg2) throws NotFoundException, DeployException { final XAManagedConnectionFactory xaManagedConnectionFactory = new XAManagedConnectionFactory(xaDataSourceConfig.getXaDataSourceProperty()); if (xaDataSourceConfig.getUrlDelimiter() != null) { xaManagedConnectionFactory.setURLDelimiter(xaDataSourceConfig.getUrlDelimiter()); } if (xaDataSourceConfig.getXaDataSourceClass() != null) { xaManagedConnectionFactory.setXADataSourceClass(xaDataSourceConfig.getXaDataSourceClass()); } if (xaDataSourceConfig.getUrlSelectorStrategyClassName() != null) { xaManagedConnectionFactory .setUrlSelectorStrategyClassName(xaDataSourceConfig.getUrlSelectorStrategyClassName()); } if (xaDataSourceConfig.getXaPool() != null && xaDataSourceConfig.getXaPool().isSameRmOverride() != null) { xaManagedConnectionFactory.setIsSameRMOverrideValue(xaDataSourceConfig.getXaPool().isSameRmOverride()); } if (xaDataSourceConfig.getNewConnectionSql() != null) { xaManagedConnectionFactory.setNewConnectionSQL(xaDataSourceConfig.getNewConnectionSql()); } if (xaDataSourceConfig.getUrlSelectorStrategyClassName() != null) { xaManagedConnectionFactory .setUrlSelectorStrategyClassName(xaDataSourceConfig.getUrlSelectorStrategyClassName()); } setMcfProperties(xaManagedConnectionFactory, xaDataSourceConfig, xaDataSourceConfig.getStatement()); return xaManagedConnectionFactory; }
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()); }