Package com.sun.enterprise.connectors

Examples of com.sun.enterprise.connectors.ConnectorConnectionPool


        _logger.fine(" JdbcConnectionPoolDeployer - actualDeployResource : " + resource );
        com.sun.enterprise.config.serverbeans.JdbcConnectionPool adminPool =
            (com.sun.enterprise.config.serverbeans.JdbcConnectionPool) resource;
       
 
  ConnectorConnectionPool connConnPool = createConnectorConnectionPool(
          adminPool);   
        
 
  //now do internal book keeping
  try {
View Full Code Here


                            + " is not referred or not yet created in this server "
                            + "instance and hence pool redeployment is ignored");
            return;
        }
       
  ConnectorConnectionPool connConnPool = createConnectorConnectionPool(
          adminPool);   

        if (connConnPool == null) {
      throw new ConnectorRuntimeException("Unable to create ConnectorConnectionPool"+
              "from JDBC connection pool");
View Full Code Here

  int txSupport = getTxSupport( moduleName );

  ConnectorDescriptor connDesc = createConnectorDescriptor( moduleDir );

        //Create the connector Connection Pool object from the configbean object
        ConnectorConnectionPool conConnPool = new ConnectorConnectionPool(
          adminPool.getName() );

        conConnPool.setTransactionSupport( txSupport );
        setConnectorConnectionPoolAttributes( conConnPool, adminPool );   
 
 

  //Initially create the ConnectorDescriptor
        ConnectorDescriptorInfo connDescInfo =
      createConnectorDescriptorInfo( connDesc, moduleName );


        connDescInfo.setMCFConfigProperties(
      getMCFConfigProperties( adminPool, conConnPool, connDesc ) );
       
        //since we are deploying a 1.0 RAR, this is null
  connDescInfo.setResourceAdapterConfigProperties((Set) null );

  conConnPool.setConnectorDescriptorInfo( connDescInfo );

  return conConnPool;

    }
View Full Code Here

          this.redeployResource(resource);
          return;
        }
         
      
        final ConnectorConnectionPool ccp =
            getConnectorConnectionPool(domainCcp);
        final String defName = domainCcp.getConnectionDefinitionName();
        final ConnectorRuntime crt = ConnectorRuntime.getRuntime();
       
        if (domainCcp.isEnabled()) {
View Full Code Here

       

        String rarName = domainCcp.getResourceAdapterName();
        String connDefName = domainCcp.getConnectionDefinitionName();
        ElementProperty[] props = domainCcp.getElementProperty();
        ConnectorConnectionPool ccp = getConnectorConnectionPool(domainCcp);
        populateConnectorConnectionPool( ccp, connDefName, rarName, props,
          securityMaps);
 
        boolean poolRecreateRequired = false;
        try
View Full Code Here

    }

    private ConnectorConnectionPool getConnectorConnectionPool(
            com.sun.enterprise.config.serverbeans.ConnectorConnectionPool
                    domainCcp) throws Exception {
        ConnectorConnectionPool ccp =
                new ConnectorConnectionPool(domainCcp.getName());
        ccp.setSteadyPoolSize(domainCcp.getSteadyPoolSize());
        ccp.setMaxPoolSize(domainCcp.getMaxPoolSize());
        ccp.setMaxWaitTimeInMillis(domainCcp.getMaxWaitTimeInMillis());
        ccp.setPoolResizeQuantity(domainCcp.getPoolResizeQuantity());
        ccp.setIdleTimeoutInSeconds(domainCcp.getIdleTimeoutInSeconds());
        ccp.setFailAllConnections(domainCcp.isFailAllConnections());
        ccp.setAuthCredentialsDefinedInPool(
                isAuthCredentialsDefinedInPool(domainCcp));
        //The line below will change for 9.0. We will get this from
        //the domain.xml
        ccp.setConnectionValidationRequired(domainCcp.isIsConnectionValidationRequired());

        String txSupport = domainCcp.getTransactionSupport();
        int txSupportIntVal = parseTransactionSupportString(txSupport);

        if (txSupportIntVal == -1) {
            //if transaction-support attribute is null load the value
            //from the ra.xml
            if (_logger.isLoggable(Level.FINE)) {
                _logger.fine("Got transaction-support attr null from domain.xml");
            }
            txSupportIntVal = ConnectionPoolObjectsUtils.getTransactionSupportFromRaXml(
                    domainCcp.getResourceAdapterName());

        } else {
            //We got some valid transaction-support attribute value
            //so go figure if it is valid.
            //The tx support is valid if it is less-than/equal-to
            //the value specified in the ra.xml
            if (!isTxSupportConfigurationSane(txSupportIntVal,
                    domainCcp.getResourceAdapterName())) {

                String i18nMsg = localStrings.getString(
                        "ccp_deployer.incorrect_tx_support");
                ConnectorRuntimeException cre = new
                        ConnectorRuntimeException(i18nMsg);

                _logger.log(Level.SEVERE, "rardeployment.incorrect_tx_support",
                        ccp.getName());
                throw cre;
            }
        }
        if (_logger.isLoggable(Level.FINE)) {
            _logger.fine("setting txSupportVal to " + txSupportIntVal +
                    " in pool " + domainCcp.getName());
        }
        ccp.setTransactionSupport(txSupportIntVal);

        //Always for ccp 
        ccp.setNonComponent(false);
        ccp.setNonTransactional(false);
        ccp.setConnectionLeakTracingTimeout(domainCcp.getConnectionLeakTimeoutInSeconds());
        ccp.setConnectionReclaim(domainCcp.isConnectionLeakReclaim());

        ccp.setMatchConnections(domainCcp.isMatchConnections());
        ccp.setAssociateWithThread(domainCcp.isAssociateWithThread());
       
        boolean lazyConnectionEnlistment = domainCcp.isLazyConnectionEnlistment();
        boolean lazyConnectionAssociation = domainCcp.isLazyConnectionAssociation();

        if (lazyConnectionAssociation) {
            if (lazyConnectionEnlistment) {
                ccp.setLazyConnectionAssoc(true);
                ccp.setLazyConnectionEnlist(true);
            } else {
                _logger.log(Level.SEVERE,
                        "conn_pool_obj_utils.lazy_enlist-lazy_assoc-invalid-combination",
                        domainCcp.getName());
                String i18nMsg = localStrings.getString(
                        "cpou.lazy_enlist-lazy_assoc-invalid-combination",  domainCcp.getName());
                throw new RuntimeException(i18nMsg);
            }
        } else {
            ccp.setLazyConnectionAssoc(lazyConnectionAssociation);
            ccp.setLazyConnectionEnlist(lazyConnectionEnlistment);
        }

        ccp.setMaxConnectionUsage(domainCcp.getMaxConnectionUsageCount());
        ccp.setValidateAtmostOncePeriod(
                domainCcp.getValidateAtmostOncePeriodInSeconds());

        ccp.setConCreationRetryAttempts(
                domainCcp.getConnectionCreationRetryAttempts());
        ccp.setConCreationRetryInterval(
                domainCcp.getConnectionCreationRetryIntervalInSeconds());

        //IMPORTANT
        //Here all properties that will be checked by the
        //convertElementPropertyToPoolProperty method need to be set to
View Full Code Here

        //do nothing
    }

    private void setPoolConfiguration(Hashtable env) throws PoolingException {

        ConnectorConnectionPool poolResource = getPoolConfigurationFromJndi(env);
        idletime = Integer.parseInt(poolResource.getIdleTimeoutInSeconds()) * 1000L;
        maxPoolSize = Integer.parseInt(poolResource.getMaxPoolSize());
        steadyPoolSize = Integer.parseInt(poolResource.getSteadyPoolSize());

        if (maxPoolSize < steadyPoolSize) {
            maxPoolSize = steadyPoolSize;
        }
        resizeQuantity = Integer.parseInt(poolResource.getPoolResizeQuantity());

        maxWaitTime = Integer.parseInt(poolResource.getMaxWaitTimeInMillis());
        //Make sure it's not negative.
        if (maxWaitTime < 0) {
            maxWaitTime = 0;
        }

        failAllConnections = poolResource.isFailAllConnections();

        validation = poolResource.isIsConnectionValidationRequired();

        validateAtmostEveryIdleSecs = poolResource.isValidateAtmostEveryIdleSecs();
        dataStructureType = poolResource.getPoolDataStructureType();
        dataStructureParameters = poolResource.getDataStructureParameters();
        poolWaitQueueClass = poolResource.getPoolWaitQueue();
        resourceSelectionStrategyClass = poolResource.getResourceSelectionStrategyClass();
        resourceGatewayClass = poolResource.getResourceGatewayClass();
        reconfigWaitTime = poolResource.getDynamicReconfigWaitTimeout();

        setAdvancedPoolConfiguration(poolResource);
    }
View Full Code Here

        setAdvancedPoolConfiguration(poolResource);
    }

    protected ConnectorConnectionPool getPoolConfigurationFromJndi(Hashtable env) throws PoolingException {
        ConnectorConnectionPool poolResource;
        try {
            String jndiNameOfPool = ConnectorAdminServiceUtils.getReservePrefixedJNDINameForPool(poolInfo);
            poolResource = (ConnectorConnectionPool)
                    ConnectorRuntime.getRuntime().getResourceNamingService().lookup(poolInfo, jndiNameOfPool, env);
        } catch (NamingException ex) {
View Full Code Here

     */

    public static ResourcePrincipal getDefaultResourcePrincipal(PoolInfo poolInfo)
            throws NamingException {
        // All this to get the default user name and principal
        ConnectorConnectionPool connectorConnectionPool = null;
        try {
            String jndiNameForPool = getReservePrefixedJNDINameForPool(poolInfo);
            Context ic = ConnectorRuntime.getRuntime().getNamingManager().getInitialContext();
            connectorConnectionPool =
                    (ConnectorConnectionPool) ic.lookup(jndiNameForPool);
        } catch (NamingException ne) {
            throw ne;
        }

        ConnectorDescriptorInfo cdi = connectorConnectionPool.
                getConnectorDescriptorInfo();

        Set mcfConfigProperties = cdi.getMCFConfigProperties();
        Iterator mcfConfPropsIter = mcfConfigProperties.iterator();
        String userName = "";
View Full Code Here

            this.redeployResource(resource);
            return;
        }

        PoolInfo poolInfo = new PoolInfo(domainCcp.getName(), applicationName, moduleName);
        final ConnectorConnectionPool ccp = getConnectorConnectionPool(domainCcp, poolInfo);
        String rarName = domainCcp.getResourceAdapterName();
        String connDefName = domainCcp.getConnectionDefinitionName();
        List<Property> props = domainCcp.getProperty();
        List<SecurityMap> securityMaps = domainCcp.getSecurityMap();
View Full Code Here

TOP

Related Classes of com.sun.enterprise.connectors.ConnectorConnectionPool

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.