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

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


   @Override
   public DataSources parse(XMLStreamReader reader) throws Exception
   {

      DataSources dataSources = null;

      //iterate over tags
      int iterate;
      try
      {
View Full Code Here


   @Override
   public DataSources parse(XMLStreamReader reader) throws Exception
   {

      DataSources dataSources = null;

      //iterate over tags
      int iterate;
      try
      {
View Full Code Here

   @Override
   public DataSources parse(XMLStreamReader reader) throws Exception
   {

      DataSources dataSources = null;

      //iterate over tags
      int iterate;
      try
      {
View Full Code Here

            subsystem.get(OP).set(ADD);
            subsystem.get(OP_ADDR).set(address);

            list.add(subsystem);

            DataSources dataSources = null;
            try {
                String localName = null;
                switch (Namespace.forUri(reader.getNamespaceURI())) {
                    case DATASOURCES_1_0: {
                        localName = reader.getLocalName();
                        Element element = Element.forName(reader.getLocalName());
                        log.tracef("%s -> %s", localName, element);
                        switch (element) {
                            case SUBSYSTEM: {

                                DsParser parser = new DsParser();
                                dataSources = parser.parse(reader);

                                // Parse what is left after the datasources element

                                parseForDrivers(reader, address, list);

                                break;
                            }
                        }
                    }
                }
            } catch (Exception e) {
                throw new XMLStreamException(e);
            }

            if (dataSources != null) {
                ModelNode datasourcesNode = subsystem.get(DATASOURCES);
                for (DataSource ds : dataSources.getDataSource()) {
                    ModelNode dsModel = new ModelNode();
                    for (Entry<String, String> entry : ds.getConnectionProperties().entrySet()) {
                        dsModel.get(CONNECTION_PROPERTIES, entry.getKey()).set(entry.getValue());
                    }
                    setIfNotNull(dsModel, CONNECTION_URL, ds.getConnectionUrl());
                    setIfNotNull(dsModel, DRIVER_CLASS, ds.getDriverClass());
                    setIfNotNull(dsModel, JNDINAME, ds.getJndiName());
                    setIfNotNull(dsModel, MODULE, ds.getModule());
                    setIfNotNull(dsModel, NEW_CONNECTION_SQL, ds.getNewConnectionSql());
                    setIfNotNull(dsModel, POOLNAME, ds.getPoolName());
                    setIfNotNull(dsModel, URL_DELIMITER, ds.getUrlDelimiter());
                    setIfNotNull(dsModel, URL_SELECTOR_STRATEGY_CLASS_NAME, ds.getUrlSelectorStrategyClassName());
                    setIfNotNull(dsModel, USE_JAVA_CONTEXT, ds.isUseJavaContext());
                    setIfNotNull(dsModel, ENABLED, ds.isEnabled());

                    CommonPool pool = ds.getPool();
                    if (pool != null) {
                        setIfNotNull(dsModel, MAX_POOL_SIZE, pool.getMaxPoolSize());
                        setIfNotNull(dsModel, MIN_POOL_SIZE, pool.getMinPoolSize());
                        setIfNotNull(dsModel, POOL_PREFILL, pool.isPrefill());
                        setIfNotNull(dsModel, POOL_USE_STRICT_MIN, pool.isUseStrictMin());
                    }
                    DsSecurity security = ds.getSecurity();
                    if (security != null) {
                        setIfNotNull(dsModel, USERNAME, security.getUserName());
                        setIfNotNull(dsModel, PASSWORD, security.getPassword());
                        setIfNotNull(dsModel, SECURITY_DOMAIN, security.getSecurityDomain());
                    }
                    Statement statement = ds.getStatement();
                    if (statement != null) {
                        setIfNotNull(dsModel, PREPAREDSTATEMENTSCACHESIZE, statement.getPreparedStatementsCacheSize());
                        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());
View Full Code Here

            final BootOperationContext updateContext = BootOperationContext.class.cast(context);
            context.getRuntimeContext().setRuntimeTask(new RuntimeTask() {
                public void execute(RuntimeTaskContext context) throws OperationFailedException {
                    final ServiceTarget serviceTarget = context.getServiceTarget();

                    DataSources datasources = null;
                    try {
                        datasources = buildDataSourcesObject(operation);
                    } catch (ValidateException e) {
                        throw new OperationFailedException(e, operation);
                    }

                    for (DataSource dataSource : datasources.getDataSource()) {
                        if (dataSource.isEnabled() != null && !dataSource.isEnabled()) {
                            continue;
                        }
                        String jndiName = dataSource.getJndiName();
                        if (dataSource.isUseJavaContext() != null && dataSource.isUseJavaContext().booleanValue() &&
                                !jndiName.startsWith("java:/")) {
                            jndiName = "java:/" + jndiName;
                        }
                        installDataSourceService(serviceTarget, jndiName, dataSource.getModule(), new LocalDataSourceService(jndiName, dataSource));

                    }
                    for (XaDataSource xaDataSource : datasources.getXaDataSource()) {
                        if (xaDataSource.isEnabled() != null && !xaDataSource.isEnabled()) {
                            continue;
                        }
                        String jndiName = xaDataSource.getJndiName();
                        if (xaDataSource.isUseJavaContext() != null && xaDataSource.isUseJavaContext().booleanValue() &&
View Full Code Here

   @Override
   public DataSources parse(XMLStreamReader reader) throws Exception
   {

      DataSources dataSources = null;

      //iterate over tags
      int iterate;
      try
      {
View Full Code Here

    private static CommonBundle bundle = Messages.getBundle(CommonBundle.class);


    public void parse(final XMLExtendedStreamReader reader, final List<ModelNode> list, ModelNode parentAddress) throws Exception {

        DataSources dataSources = null;

        //iterate over tags
        int iterate;
        try {
            iterate = reader.nextTag();
View Full Code Here

            InputStream xmlStream = null;
            try {
                xmlStream = new FileInputStream(f.getPhysicalFile());
                DsParser parser = new DsParser();
                parser.setSystemPropertiesResolved(resolveProperties);
                DataSources dataSources = parser.parse(xmlStream);
                if (dataSources != null) {
                    deploymentUnit.addToAttachmentList(DATA_SOURCES_ATTACHMENT_KEY, dataSources);
                }
            } catch (Exception e) {
                throw new DeploymentUnitProcessingException(e.getMessage(), e);
View Full Code Here

                this.serviceContainer = serviceContainer;

                HashMap<String, org.jboss.jca.common.api.metadata.ds.Driver> drivers = new HashMap<String, org.jboss.jca.common.api.metadata.ds.Driver>(
                        1);

                DataSources dataSources = null;
                if (dataSourceConfig != null) {
                    String driverName = dataSourceConfig.getDriver();
                    InstalledDriver installedDriver = driverRegistry.getValue().getInstalledDriver(driverName);
                    if (installedDriver != null) {
                        String moduleName = installedDriver.getModuleName() != null ? installedDriver.getModuleName().getName()
View Full Code Here

    private static CommonBundle bundle = Messages.getBundle(CommonBundle.class);


    public void parse(final XMLExtendedStreamReader reader, final List<ModelNode> list, ModelNode parentAddress) throws Exception {

        DataSources dataSources = null;

        //iterate over tags
        int iterate;
        try {
            iterate = reader.nextTag();
View Full Code Here

TOP

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

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.