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

Examples of org.jboss.jca.common.api.metadata.common.CommonPool


   {
      HashMap<String, String> configProperties = new HashMap<String, String>();
      CommonSecurity security = null;
      CommonTimeOut timeOut = null;
      CommonValidation validation = null;
      CommonPool pool = null;
      Recovery recovery = null;

      //attributes reading
      boolean useJavaContext = true;
      String className = null;
View Full Code Here


      Statement statementSettings = null;
      Validation validationSettings = null;
      String urlDelimiter = null;
      String urlSelectorStrategyClassName = null;
      String newConnectionSql = null;
      CommonPool pool = null;

      //attributes reading
      boolean useJavaContext = true;
      String poolName = null;
      boolean enabled = true;
View Full Code Here

      Statement statementSettings = null;
      Validation validationSettings = null;
      String urlDelimiter = null;
      String urlSelectorStrategyClassName = null;
      String newConnectionSql = null;
      CommonPool pool = null;

      //attributes reading
      Boolean useJavaContext = Defaults.USE_JAVA_CONTEXT;
      String poolName = null;
      Boolean enabled = Defaults.ENABLED;
View Full Code Here

            Long blockingTimeoutMillis = getLongIfSetOrGetDefault(conDefNode, BLOCKING_TIMEOUT_WAIT_MILLIS, null);
            Long idleTimeoutMinutes = getLongIfSetOrGetDefault(conDefNode, IDLETIMEOUTMINUTES, null);
            Integer xaResourceTimeout = getIntIfSetOrGetDefault(conDefNode, XA_RESOURCE_TIMEOUT, null);
            CommonTimeOut timeOut = new CommonTimeOutImpl(blockingTimeoutMillis, idleTimeoutMinutes, allocationRetry,
                    allocationRetryWaitMillis, xaResourceTimeout);
            CommonPool pool = new CommonPoolImpl(minPoolSize, maxPoolSize, prefill, useStrictMin);

            String securityDomain = getStringIfSetOrGetDefault(conDefNode, SECURITY_DOMAIN, null);
            String securityDomainAndApplication = getStringIfSetOrGetDefault(conDefNode, SECURITY_DOMAIN_AND_APPLICATION, null);
            boolean application = getBooleanIfSetOrGetDefault(conDefNode, APPLICATION, false);
            CommonSecurity security = new CommonSecurityImpl(securityDomain, securityDomainAndApplication, application);
View Full Code Here

                    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());
                    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());
View Full Code Here

                    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);
                    CommonPool pool = new CommonPoolImpl(minPoolSize, maxPoolSize, prefill, useStrictMin);

                    String username = getStringIfSetOrGetDefault(dataSourceNode, USERNAME, null);
                    String password = getStringIfSetOrGetDefault(dataSourceNode, PASSWORD, null);
                    String securityDomain = getStringIfSetOrGetDefault(dataSourceNode, SECURITY_DOMAIN, null);
View Full Code Here

      Statement statementSettings = null;
      Validation validationSettings = null;
      String urlDelimiter = null;
      String urlSelectorStrategyClassName = null;
      String newConnectionSql = null;
      CommonPool pool = null;

      //attributes reading
      Boolean useJavaContext = Defaults.USE_JAVA_CONTEXT;
      String poolName = null;
      Boolean enabled = Defaults.ENABLED;
View Full Code Here

   {
      Map<String, String> configProperties = new HashMap<String, String>();
      CommonSecurity security = null;
      CommonTimeOut timeOut = null;
      CommonValidation validation = null;
      CommonPool pool = null;
      Recovery recovery = null;

      //attributes reading
      Boolean useJavaContext = Boolean.TRUE;
      String className = null;
View Full Code Here

                  if (introspected == null)
                     out.println("  Unable to resolve introspected config-property's");

                  String poolName = getValueString(mcf.getConnectionInterface()).substring(
                     getValueString(mcf.getConnectionInterface()).lastIndexOf('.') + 1);
                  CommonPool pool = null;
                  CommonConnDefImpl connImpl;
                  if (transSupport.equals(TransactionSupportEnum.XATransaction))
                  {
                     pool = xaPoolImpl;
                     Recovery recovery = new Recovery(new CredentialImpl("user", "password", null), null, false);
                     connImpl = new CommonConnDefImpl(configProperty, mcfClassName, "java:jboss/eis/" + poolName,
                        poolName, Defaults.ENABLED, Defaults.USE_JAVA_CONTEXT, Defaults.USE_CCM, pool, null, null,
                        secImpl, recovery, Boolean.TRUE);
                  }
                  else
                  {
                     pool = poolImpl;
                     connImpl = new CommonConnDefImpl(configProperty, mcfClassName, "java:jboss/eis/" + poolName,
                        poolName, Defaults.ENABLED, Defaults.USE_JAVA_CONTEXT, Defaults.USE_CCM, pool, null, null,
                        secImpl, null, Boolean.FALSE);
                  }

                  connDefs.add(connImpl);
               }

            }

            line = 0;
            sameClassnameSet.clear();

            if (ra1516.getAdminObjects() != null && ra1516.getAdminObjects().size() > 0)
            {
               out.println();
               out.println("Admin-object:");
               out.println("-------------");
               adminObjects = new ArrayList<CommonAdminObject>();

               for (AdminObject ao : ra1516.getAdminObjects())
               {
                  String aoClassname = getValueString(ao.getAdminobjectClass());
                  if (!sameClassnameSet.contains(aoClassname))
                  {
                     sameClassnameSet.add(aoClassname);
                     if (line != 0)
                     {
                        out.println();
                     }
                     line++;
                     out.println("Class: " + aoClassname);
                     out.println("  Interface: " + getValueString(ao.getAdminobjectInterface()));
                     needPrint = true;
                  }
                  else
                  {
                     needPrint = false;
                  }

                  String poolName = aoClassname.substring(aoClassname.lastIndexOf('.') + 1);
                  Map<String, String> configProperty = null;
                  if (ao.getConfigProperties() != null)
                     configProperty = new HashMap<String, String>();
              
                  introspected = getIntrospectedProperties(aoClassname, cl);
              
                  for (ConfigProperty cp : ao.getConfigProperties())
                  {
                     configProperty.put(getValueString(cp.getConfigPropertyName()),
                                        getValueString(cp.getConfigPropertyValue()));
                    
                     removeIntrospectedValue(introspected, getValueString(cp.getConfigPropertyName()));
                 
                     if (needPrint)
                        out.println("  Config-property: " + getValueString(cp.getConfigPropertyName()) + " (" +
                                    getValueString(cp.getConfigPropertyType()) + ")");
                  }

                  if (introspected != null && !introspected.isEmpty())
                  {
                     for (Map.Entry<String, String> entry : introspected.entrySet())
                     {
                        if (needPrint)
                           out.println("  Introspected Config-property: " + entry.getKey() + " (" +
                                       entry.getValue() + ")");
                     }
                  }
                 
                  if (introspected == null)
                     out.println("  Unable to resolve introspected config-property's");

                  CommonAdminObjectImpl aoImpl = new CommonAdminObjectImpl(configProperty, aoClassname,
                     "java:jboss/eis/ao/" + poolName, poolName, Defaults.ENABLED, Defaults.USE_JAVA_CONTEXT);
                  adminObjects.add(aoImpl);
               }
            }
           
            line = 0;
            sameClassnameSet.clear();

            if (ra1516.getInboundResourceadapter() != null &&
                ra1516.getInboundResourceadapter().getMessageadapter() != null &&
                ra1516.getInboundResourceadapter().getMessageadapter().getMessagelisteners() != null &&
                ra1516.getInboundResourceadapter().getMessageadapter().getMessagelisteners().size() > 0)
            {
               out.println();
               out.println("Activation-spec:");
               out.println("----------------");
               for (MessageListener ml :
                  ra1516.getInboundResourceadapter().getMessageadapter().getMessagelisteners())
               {
                  String asClassname = getValueString(ml.getActivationspec().getActivationspecClass());
                  if (!sameClassnameSet.contains(asClassname))
                  {
                     sameClassnameSet.add(asClassname);
                     if (line != 0)
                     {
                        out.println();
                     }
                     line++;
                     out.println("Class: " + asClassname);
                     out.println("  Message-listener: " + getValueString(ml.getMessagelistenerType()));

                     introspected = getIntrospectedProperties(asClassname, cl);

                     if (ml.getActivationspec() != null &&
                         ml.getActivationspec().getRequiredConfigProperties() != null)
                     {
                        for (RequiredConfigProperty cp :  ml.getActivationspec().getRequiredConfigProperties())
                        {
                           removeIntrospectedValue(introspected, getValueString(cp.getConfigPropertyName()));
                          
                           out.println("  Required-config-property: " + getValueString(cp.getConfigPropertyName()));
                        }
                     }

                     if (introspected != null && !introspected.isEmpty())
                     {
                        for (Map.Entry<String, String> entry : introspected.entrySet())
                        {
                           out.println("  Introspected Config-property: " + entry.getKey() + " (" +
                                       entry.getValue() + ")");
                        }
                     }

                     if (introspected == null)
                        out.println("  Unable to resolve introspected config-property's");
                  }
               }
            }
         }
         else
         {
            out.println("Managed-connection-factory:");
            out.println("---------------------------");

            ResourceAdapter10 ra10 = (ResourceAdapter10)ra;
            out.println("Class: " + ra10.getManagedConnectionFactoryClass());
           
            mcfClassName = getValueString(ra10.getManagedConnectionFactoryClass());
            transSupport = ra10.getTransactionSupport();
           
            //ValidatingManagedConnectionFactory
            hasValidatingMcfInterface(out, mcfClassName, cl);
           
            //DissociatableManagedConnection
            hasDissociatableMcInterface(out, mcfClassName, cl, ra10.getConfigProperties());
           
            //LazyEnlistableManagedConnection
            hasEnlistableMcInterface(out, mcfClassName, cl, ra10.getConfigProperties());
           
            Class<?> cfi = Class.forName(mcfClassName, true, cl);
            out.println("  ConnectionFactory (" + mcfClassName + "):");
            outputMethodInfo(out, cfi, cl);
           
            Class<?> ci = Class.forName(getValueString(ra10.getConnectionInterface()), true, cl);
            out.println("  Connection (" + getValueString(ra10.getConnectionInterface()) + "):");
            outputMethodInfo(out, ci, cl);
           
            Map<String, String> configProperty = null;
            if (ra10.getConfigProperties() != null)
               configProperty = new HashMap<String, String>();

            Map<String, String> introspected =
               getIntrospectedProperties(mcfClassName, cl);

            for (ConfigProperty cp : ra10.getConfigProperties())
            {
               configProperty.put(getValueString(cp.getConfigPropertyName()),
                                  getValueString(cp.getConfigPropertyValue()));
              
               removeIntrospectedValue(introspected, getValueString(cp.getConfigPropertyName()));
              
               out.println("  Config-property: " + getValueString(cp.getConfigPropertyName()) + " (" +
                           getValueString(cp.getConfigPropertyType()) + ")");
            }
           
            if (introspected != null && !introspected.isEmpty())
            {
               for (Map.Entry<String, String> entry : introspected.entrySet())
               {
                  out.println("  Introspected Config-property: " + entry.getKey() + " (" +
                              entry.getValue() + ")");
               }
            }

            if (introspected == null)
               out.println("  Unable to resolve introspected config-property's");

            String poolName = mcfClassName.substring(mcfClassName.lastIndexOf('.') + 1);
            CommonPool pool = null;
            if (transSupport.equals(TransactionSupportEnum.XATransaction))
            {
               pool = xaPoolImpl;
            }
            else
View Full Code Here

        final boolean prefill = getBooleanIfSetOrGetDefault(dataSourceNode, POOL_PREFILL, Defaults.PREFILL);
        final boolean useStrictMin = getBooleanIfSetOrGetDefault(dataSourceNode, POOL_USE_STRICT_MIN, Defaults.USE_STRICT_MIN);
        final FlushStrategy flushStrategy = dataSourceNode.hasDefined(POOL_FLUSH_STRATEGY.getName()) ? FlushStrategy.forName(dataSourceNode
                .get(POOL_FLUSH_STRATEGY.getName()).asString()) : Defaults.FLUSH_STRATEGY;

        final CommonPool pool = new CommonPoolImpl(minPoolSize, maxPoolSize, prefill, useStrictMin, flushStrategy);

        final String username = getStringIfSetOrGetDefault(dataSourceNode, USERNAME, null);

        final String password = getResolvedStringIfSetOrGetDefault(operationContext, dataSourceNode, PASSWORD, null);
        final String securityDomain = getStringIfSetOrGetDefault(dataSourceNode, SECURITY_DOMAIN, null);
View Full Code Here

TOP

Related Classes of org.jboss.jca.common.api.metadata.common.CommonPool

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.