KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > resource > JdbcConnectionPoolDeployer


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * @(#) JdbcConnectionPoolDeployer.java
26  *
27  * Copyright 2000-2001 by iPlanet/Sun Microsystems, Inc.,
28  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
29  * All rights reserved.
30  *
31  * This software is the confidential and proprietary information
32  * of iPlanet/Sun Microsystems, Inc. ("Confidential Information").
33  * You shall not disclose such Confidential Information and shall
34  * use it only in accordance with the terms of the license
35  * agreement you entered into with iPlanet/Sun Microsystems.
36  */

37 package com.sun.enterprise.resource;
38
39 import com.sun.enterprise.config.serverbeans.ElementProperty;
40 import com.sun.enterprise.config.serverbeans.JdbcConnectionPool;
41 import com.sun.enterprise.config.serverbeans.Resources;
42 import com.sun.enterprise.connectors.ConnectorConnectionPool;
43 import com.sun.enterprise.connectors.ConnectorConstants;
44 import com.sun.enterprise.connectors.ConnectorDescriptorInfo;
45 import com.sun.enterprise.connectors.ConnectorRuntime;
46 import com.sun.enterprise.connectors.ConnectorRuntimeException;
47 import com.sun.enterprise.connectors.util.ConnectionPoolObjectsUtils;
48 import com.sun.enterprise.connectors.util.ConnectionPoolObjectsUtils;
49 import com.sun.enterprise.deployment.archivist.ConnectorArchivist;
50 import com.sun.enterprise.deployment.ConnectionDefDescriptor;
51 import com.sun.enterprise.deployment.ConnectorDescriptor;
52 import com.sun.enterprise.deployment.deploy.shared.FileArchive;
53 import com.sun.enterprise.deployment.EnvironmentProperty;
54 import com.sun.enterprise.NamingManager;
55 import com.sun.enterprise.resource.ResourceInstaller;
56 import com.sun.enterprise.server.Constants;
57 import com.sun.enterprise.server.ResourceDeployer;
58 import com.sun.enterprise.Switch;
59 import com.sun.enterprise.util.i18n.StringManager;
60 import com.sun.enterprise.util.Utility;
61 import com.sun.logging.LogDomains;
62
63 import java.io.File JavaDoc;
64 import java.util.ArrayList JavaDoc;
65 import java.util.HashMap JavaDoc;
66 import java.util.HashSet JavaDoc;
67 import java.util.Iterator JavaDoc;
68 import java.util.ListIterator JavaDoc;
69 import java.util.logging.Level JavaDoc;
70 import java.util.logging.Logger JavaDoc;
71 import java.util.Map JavaDoc;
72 import java.util.MissingResourceException JavaDoc;
73 import java.util.Set JavaDoc;
74
75 /**
76  * Handles Jdbc connection pool events in the server instance. When user adds a
77  * jdbc connection pool , the admin instance emits resource event. The jdbc
78  * connection pool events are propagated to this object.
79  *
80  * The methods can potentially be called concurrently, therefore implementation
81  * need to be synchronized.
82  *
83  * @author Tamil Vengan
84  */

85
86  // This class was created to fix the bug # 4650787
87

88 public class JdbcConnectionPoolDeployer implements ResourceDeployer {
89
90     static private StringManager sm = StringManager.getManager(
91             JdbcConnectionPoolDeployer.class);
92     static private String JavaDoc msg = sm.getString("resource.restart_needed");
93     
94     static private Logger JavaDoc _logger = LogDomains.getLogger(LogDomains.RSR_LOGGER);
95     
96     public synchronized void deployResource(Object JavaDoc resource) throws Exception JavaDoc {
97         //intentional no-op
98
//From 8.1 PE/SE/EE, JDBC connection pools are no more resources and
99
//they would be available only to server instances that have a resoruce-ref
100
//that maps to a pool. So deploy resource would not be called during
101
//JDBC connection pool creation. The actualDeployResource method
102
//below is invoked by JdbcResourceDeployer when a resource-ref for a
103
//resource that is pointed to this pool is added to a server instance
104

105         _logger.fine(" JdbcConnectionPoolDeployer - deployResource : " + resource + " calling actualDeploy");
106         actualDeployResource(resource);
107     }
108     
109     /**
110      * Deploy the resource into the server's runtime naming context
111      *
112      * @param resoure a resource object
113      * @exception Exception thrown if fail
114      */

115     public synchronized void actualDeployResource(Object JavaDoc resource) throws Exception JavaDoc {
116         _logger.fine(" JdbcConnectionPoolDeployer - actualDeployResource : " + resource );
117         com.sun.enterprise.config.serverbeans.JdbcConnectionPool adminPool =
118             (com.sun.enterprise.config.serverbeans.JdbcConnectionPool) resource;
119         
120     
121     ConnectorConnectionPool connConnPool = createConnectorConnectionPool(
122             adminPool);
123          
124     
125     //now do internal book keeping
126
try {
127         ConnectorRuntime.getRuntime().createConnectorConnectionPool(
128             connConnPool);
129     } catch( ConnectorRuntimeException cre ) {
130         cre.printStackTrace();
131     }
132     }
133
134     public synchronized void undeployResource(Object JavaDoc resource) throws Exception JavaDoc {
135         _logger.fine(" JdbcConnectionPoolDeployer - unDeployResource : " +
136                                 "calling actualUndeploy of " + resource);
137         actualUndeployResource(resource);
138     }
139     
140     /**
141      * Undeploy the resource from the server's runtime naming context
142      *
143      * @param resoure a resource object
144      * @exception Currently we are not supporting this method.
145      * So, UnsupportedOperationException will be throwed
146      */

147
148     public synchronized void actualUndeployResource(Object JavaDoc resource) throws Exception JavaDoc{
149         _logger.fine(" JdbcConnectionPoolDeployer - unDeployResource : " + resource);
150         
151         com.sun.enterprise.config.serverbeans.JdbcConnectionPool jdbcConnPool =
152         (com.sun.enterprise.config.serverbeans.JdbcConnectionPool) resource;
153
154     String JavaDoc poolName = jdbcConnPool.getName();
155     ConnectorRuntime runtime = ConnectorRuntime.getRuntime();
156     runtime.deleteConnectorConnectionPool( poolName );
157     if ( _logger.isLoggable( Level.FINEST ) ) {
158         _logger.finest("Pool Undeployed");
159     }
160     }
161
162     /**
163      * Redeploy the resource into the server's runtime naming context
164      *
165      * @param resoure a resource object
166      * @exception Currently we are not supporting this method.
167      * So, UnsupportedOperationException will be throwed
168      */

169     public synchronized void redeployResource(Object JavaDoc resource) throws Exception JavaDoc {
170          
171         com.sun.enterprise.config.serverbeans.JdbcConnectionPool adminPool
172             = (com.sun.enterprise.config.serverbeans.JdbcConnectionPool)
173         resource;
174
175
176         //Only if pool has already been deployed in this server-instance
177
//reconfig this pool
178
if (!ConnectorRuntime.getRuntime().
179                         isConnectorConnectionPoolDeployed(adminPool.getName())) {
180             
181             _logger.fine("The JDBC connection pool " + adminPool.getName()
182                             + " is not referred or not yet created in this server "
183                             + "instance and hence pool redeployment is ignored");
184             return;
185         }
186         
187     ConnectorConnectionPool connConnPool = createConnectorConnectionPool(
188             adminPool);
189
190         if (connConnPool == null) {
191         throw new ConnectorRuntimeException("Unable to create ConnectorConnectionPool"+
192                 "from JDBC connection pool");
193     }
194
195     //now do internal book keeping
196
ConnectorRuntime runtime = ConnectorRuntime.getRuntime();
197     HashSet JavaDoc excludes = new HashSet JavaDoc();
198     //add MCF config props to the set that need to be excluded
199
//in checking for the equality of the props with old pool
200
excludes.add( "TransactionIsolation");
201     excludes.add( "GuaranteeIsolationLevel");
202     excludes.add( "ValidationTableName");
203     excludes.add( "ConnectionValidationRequired");
204     excludes.add( "ValidationMethod");
205     try {
206         _logger.finest("Calling reconfigure pool");
207         boolean poolRecreateRequired =
208             runtime.reconfigureConnectorConnectionPool(connConnPool,
209                 excludes);
210         if ( poolRecreateRequired ) {
211            _logger.finest("Pool recreation required");
212            runtime.recreateConnectorConnectionPool( connConnPool );
213            _logger.finest("Pool recreation done");
214         }
215     } catch( ConnectorRuntimeException cre ) {
216         cre.printStackTrace();
217         throw cre;
218     }
219     }
220
221     /**
222      * Enable the resource in the server's runtime naming context
223      *
224      * @param resoure a resource object
225      * @exception Currently we are not supporting this method.
226      * So, UnsupportedOperationException will be throwed
227      */

228     public synchronized void enableResource(Object JavaDoc resource) throws Exception JavaDoc {
229         throw new UnsupportedOperationException JavaDoc(msg);
230     }
231
232     /**
233      * Disable the resource in the server's runtime naming context
234      *
235      * @param resoure a resource object
236      * @exception Currently we are not supporting this method.
237      * So, UnsupportedOperationException will be throwed
238      */

239     public synchronized void disableResource(Object JavaDoc resource) throws Exception JavaDoc {
240         throw new UnsupportedOperationException JavaDoc(msg);
241     }
242
243
244     /**
245      * Utility method to find a resource from Resources beans and convert
246      * it to a resource object to be used by the implemented ResourceDeployer
247      *
248      * @param name connection pool name
249      * @param rbeans Resources config-beans
250      * @exception Exception thrown if fail
251      */

252     public Object JavaDoc getResource(String JavaDoc name, Resources rbeans) throws Exception JavaDoc {
253         Object JavaDoc res = rbeans.getJdbcConnectionPoolByName(name);
254
255         if (res == null) {
256         String JavaDoc msg = sm.getString("resource.no_resource",name);
257             throw new Exception JavaDoc(msg);
258         }
259
260         return res;
261     }
262
263     /**
264      * Load the default RA descriptor from the installed system RAR
265      *
266      * @param moduleDir - the location where the rar is installed
267      * @return ConnectorDescriptor for the RAR
268      *
269      * @see ConnectorDescriptor;
270      */

271     private ConnectorDescriptor createConnectorDescriptor(
272             String JavaDoc moduleDir ) {
273
274     ConnectorDescriptor connectorDescriptor = null ;
275         FileArchive fa = new FileArchive();
276     try {
277             fa.open( moduleDir ); // directory where rar is exploded
278
ConnectorArchivist archivist = new ConnectorArchivist();
279             connectorDescriptor = (ConnectorDescriptor)
280             archivist.open(fa);
281     } catch( Exception JavaDoc ioe ) {
282         ioe.printStackTrace();
283     }
284
285     return connectorDescriptor;
286     }
287     
288   
289     /**
290      * Pull out the MCF configuration properties and return them as an array
291      * of EnvironmentProperty
292      *
293      * @param jcp - The JdbcConnectionPool to pull out properties from
294      * @param connDesc - The ConnectorDescriptor for this JDBC RA
295      *
296      * @return EnvironmentProperty[] array of MCF Config properties specified
297      * in this JDBC RA
298      */

299     private EnvironmentProperty[] getMCFConfigProperties(
300             JdbcConnectionPool adminPool,
301             ConnectorConnectionPool conConnPool, ConnectorDescriptor connDesc )
302     {
303         
304     ArrayList JavaDoc propList = new ArrayList JavaDoc();
305
306     propList.add( new EnvironmentProperty("ClassName",
307        adminPool.getDatasourceClassname() == null ? "" :
308        adminPool.getDatasourceClassname(),
309        "The datasource class name",
310        "java.lang.String") );
311        
312
313     propList.add( new EnvironmentProperty("ConnectionValidationRequired",
314         adminPool.isIsConnectionValidationRequired()+"",
315         "Is connection validation required",
316         "java.lang.String" ));
317     
318     propList.add( new EnvironmentProperty("ValidationMethod",
319        adminPool.getConnectionValidationMethod() == null ? "" :
320            adminPool.getConnectionValidationMethod(),
321        "How the connection is validated",
322        "java.lang.String") );
323
324         propList.add( new EnvironmentProperty("ValidationTableName",
325        adminPool.getValidationTableName() == null ?
326        "" : adminPool.getValidationTableName(),
327        "Validation Table name",
328        "java.lang.String") );
329
330         propList.add( new EnvironmentProperty("TransactionIsolation",
331        adminPool.getTransactionIsolationLevel() == null ? "" :
332            adminPool.getTransactionIsolationLevel(),
333        "Transaction Isolatin Level",
334        "java.lang.String") );
335
336         propList.add( new EnvironmentProperty("GuaranteeIsolationLevel",
337         adminPool.isIsIsolationLevelGuaranteed() + "",
338        "Transaction Isolation Guarantee",
339        "java.lang.String") );
340
341        
342         //dump user defined poperties into the list
343
Set JavaDoc connDefDescSet = connDesc.getOutboundResourceAdapter().
344         getConnectionDefs();
345     //since this a 1.0 RAR, we will have only 1 connDefDesc
346
if ( connDefDescSet.size() != 1 ) {
347         throw new MissingResourceException JavaDoc("Only one connDefDesc present",
348             null, null );
349     }
350     
351     Iterator JavaDoc iter = connDefDescSet.iterator();
352         
353     //Now get the set of MCF config properties associated with each
354
//connection-definition . Each element here is an EnviromnentProperty
355
Set JavaDoc mcfConfigProps = null;
356     while( iter.hasNext() ) {
357             mcfConfigProps = ((ConnectionDefDescriptor)iter.next()).
358             getConfigProperties();
359     }
360         if (mcfConfigProps != null) {
361     
362         Map JavaDoc mcfConPropKeys = new HashMap JavaDoc();
363         Iterator JavaDoc mcfConfigPropsIter = mcfConfigProps.iterator();
364         while( mcfConfigPropsIter.hasNext() ) {
365             String JavaDoc key = ((EnvironmentProperty)mcfConfigPropsIter.next()).
366             getName();
367             mcfConPropKeys.put( key.toUpperCase(), key );
368         }
369  
370             String JavaDoc driverProperties = "";
371             for( ElementProperty rp : adminPool.getElementProperty()) {
372             if ( rp == null ) {
373                     continue;
374             }
375                 String JavaDoc name = (String JavaDoc) rp.getName();
376         
377         //The idea here is to convert the Environment Properties coming from
378
//the admin connection pool to standard pool properties thereby
379
//making it easy to compare in the event of a reconfig
380
if ( "MATCHCONNECTIONS".equals( name.toUpperCase()) ) {
381                     //JDBC - matchConnections if not set is decided by the ConnectionManager
382
//so default is false
383
conConnPool.setMatchConnections( toBoolean( rp.getValue(), false ) );
384             logFine("MATCHCONNECTIONS");
385             
386         } else if ( "LAZYCONNECTIONASSOCIATION".equals(name.toUpperCase()) ) {
387                 ConnectionPoolObjectsUtils.setLazyEnlistAndLazyAssocProperties(rp.getValue(),adminPool, conConnPool);
388             logFine("LAZYCONNECTIONASSOCIATION");
389
390         } else if ( "LAZYCONNECTIONENLISTMENT".equals(name.toUpperCase()) ) {
391             conConnPool.setLazyConnectionEnlist( toBoolean( rp.getValue(), false )) ;
392             logFine("LAZYCONNECTIONENLISTMENT");
393             
394         } else if ("ASSOCIATEWITHTHREAD".equals( name.toUpperCase() ) ) {
395             conConnPool.setAssociateWithThread( toBoolean(rp.getValue(), false)) ;
396             logFine( "ASSOCIATEWITHTHREAD");
397             
398         } else if ("CONNECTIONLEAKTRACING".equals(name.toUpperCase())) {
399             conConnPool.setConnectionLeakTracing(toBoolean(rp.getValue(), false));
400             logFine("CONNECTIONLEAKTRACING");
401
402         } else if ("USERNAME".equals(name.toUpperCase()) ||
403                 "USER".equals( name.toUpperCase() ) ) {
404         
405                     propList.add( new EnvironmentProperty( "User",
406                         rp.getValue(), "user name", "java.lang.String") );
407
408         } else if ("PASSWORD".equals(name.toUpperCase()) ) {
409
410                     propList.add( new EnvironmentProperty( "Password",
411                         rp.getValue(), "Password", "java.lang.String") );
412
413         } else if (mcfConPropKeys.containsKey(name.toUpperCase())) {
414
415                     propList.add( new EnvironmentProperty(
416                         (String JavaDoc)mcfConPropKeys.get(name.toUpperCase()),
417                         rp.getValue() == null ? "" : (rp.getValue()).toString(),
418                         "Some property",
419                         "java.lang.String") );
420                 } else {
421                     driverProperties = driverProperties + "set" + name
422                 + "#" + rp.getValue() +"##";
423                 }
424             }
425
426         if (! driverProperties.equals("") ) {
427             propList.add( new EnvironmentProperty("DriverProperties",
428                 driverProperties,
429                 "some proprietarty properties",
430                 "java.lang.String"));
431             }
432     }
433     
434     
435     propList.add( new EnvironmentProperty("Delimiter",
436         "#", "delim", "java.lang.String" ) );
437     //create an array of EnvironmentProperties from above list
438
EnvironmentProperty[] eProps = new EnvironmentProperty[ propList.size() ];
439         ListIterator JavaDoc propListIter = propList.listIterator();
440             
441     for( int i = 0; propListIter.hasNext(); i++ ) {
442         eProps[i] = (EnvironmentProperty) propListIter.next();
443     }
444     
445         return eProps;
446
447     }
448
449     private String JavaDoc getSystemModuleLocation(String JavaDoc moduleName) {
450         String JavaDoc j2eeModuleDirName = System.getProperty(Constants.INSTALL_ROOT) +
451                 File.separator + "lib" + File.separator + "install" +
452                 File.separator + "applications" + File.separator + moduleName;
453
454     return j2eeModuleDirName;
455     
456     }
457     private boolean toBoolean( Object JavaDoc prop, boolean defaultVal ) {
458         if ( prop == null ) {
459             return defaultVal;
460         }
461         return (new Boolean JavaDoc( ((String JavaDoc)prop).toLowerCase())).booleanValue();
462     }
463
464     private void logFine( String JavaDoc msg ) {
465         if ( _logger.isLoggable(Level.FINE) && msg != null ) {
466         _logger.fine( msg );
467     }
468     }
469
470     public ConnectorConnectionPool createConnectorConnectionPool(
471             JdbcConnectionPool adminPool)
472     {
473
474     String JavaDoc moduleName = getModuleName( adminPool );
475         String JavaDoc moduleDir = getSystemModuleLocation( moduleName );
476     int txSupport = getTxSupport( moduleName );
477
478     ConnectorDescriptor connDesc = createConnectorDescriptor( moduleDir );
479
480         //Create the connector Connection Pool object from the configbean object
481
ConnectorConnectionPool conConnPool = new ConnectorConnectionPool(
482             adminPool.getName() );
483
484         conConnPool.setTransactionSupport( txSupport );
485         setConnectorConnectionPoolAttributes( conConnPool, adminPool );
486     
487     
488
489     //Initially create the ConnectorDescriptor
490
ConnectorDescriptorInfo connDescInfo =
491         createConnectorDescriptorInfo( connDesc, moduleName );
492
493
494         connDescInfo.setMCFConfigProperties(
495         getMCFConfigProperties( adminPool, conConnPool, connDesc ) );
496         
497         //since we are deploying a 1.0 RAR, this is null
498
connDescInfo.setResourceAdapterConfigProperties((Set JavaDoc) null );
499
500     conConnPool.setConnectorDescriptorInfo( connDescInfo );
501
502     return conConnPool;
503
504     }
505     
506     private String JavaDoc getModuleName( JdbcConnectionPool jcp ) {
507
508         String JavaDoc resType = jcp.getResType();
509     String JavaDoc dsClassName = jcp.getDatasourceClassname();
510
511         String JavaDoc moduleName = ConnectorConstants.JDBCDATASOURCE_RA_NAME;
512  
513     if (resType == null) {
514         // default to non-xa
515
return moduleName;
516     }
517
518         if ("javax.sql.XADataSource".equals(resType) && dsClassName != null) {
519
520             try {
521                 Class JavaDoc dsClass = Utility.loadClass( dsClassName );
522                 if (javax.sql.XADataSource JavaDoc.class.isAssignableFrom(dsClass)) {
523                     return ConnectorConstants.JDBCXA_RA_NAME;
524                 }
525             } catch (ClassNotFoundException JavaDoc e) {
526                 //ignore
527
}
528         }
529
530         if ("javax.sql.ConnectionPoolDataSource".equals(resType) &&
531         dsClassName != null) {
532
533             try {
534                 Class JavaDoc dsClass = Utility.loadClass( dsClassName );
535                 if (javax.sql.ConnectionPoolDataSource JavaDoc.class.isAssignableFrom(dsClass)) {
536                     return ConnectorConstants.JDBCCONNECTIONPOOLDATASOURCE_RA_NAME;
537                 }
538             } catch (ClassNotFoundException JavaDoc e) {
539                 //ignore
540
}
541         }
542
543     return moduleName;
544
545     }
546
547     private int getTxSupport( String JavaDoc moduleName ) {
548         if ( ConnectorConstants.JDBCXA_RA_NAME.equals(moduleName)) {
549         return ConnectionPoolObjectsUtils.parseTransactionSupportString(
550             ConnectorConstants.XA_TRANSACTION_TX_SUPPORT_STRING );
551     }
552
553     return ConnectionPoolObjectsUtils.parseTransactionSupportString(
554         ConnectorConstants.LOCAL_TRANSACTION_TX_SUPPORT_STRING );
555     }
556
557     private ConnectorDescriptorInfo createConnectorDescriptorInfo(
558         ConnectorDescriptor connDesc, String JavaDoc moduleName )
559     {
560         ConnectorDescriptorInfo connDescInfo = new ConnectorDescriptorInfo();
561
562         connDescInfo.setManagedConnectionFactoryClass(
563         connDesc.getOutboundResourceAdapter().
564         getManagedConnectionFactoryImpl() );
565     
566     connDescInfo.setRarName( moduleName );
567
568         connDescInfo.setResourceAdapterClassName( connDesc.
569         getResourceAdapterClass() );
570         
571     connDescInfo.setConnectionDefinitionName(
572         connDesc.getOutboundResourceAdapter().
573         getConnectionFactoryIntf() );
574     
575     connDescInfo.setConnectionFactoryClass(
576         connDesc.getOutboundResourceAdapter().
577         getConnectionFactoryImpl() );
578
579     connDescInfo.setConnectionFactoryInterface(
580         connDesc.getOutboundResourceAdapter().
581         getConnectionFactoryIntf() );
582
583     connDescInfo.setConnectionClass(
584         connDesc.getOutboundResourceAdapter().
585         getConnectionImpl() );
586     
587     connDescInfo.setConnectionInterface(
588         connDesc.getOutboundResourceAdapter().
589         getConnectionIntf() );
590
591     return connDescInfo;
592     }
593
594     private void setConnectorConnectionPoolAttributes(
595             ConnectorConnectionPool ccp, JdbcConnectionPool adminPool )
596     {
597         ccp.setMaxPoolSize( adminPool.getMaxPoolSize() != null ?
598         adminPool.getMaxPoolSize() :
599         adminPool.getDefaultMaxPoolSize() );
600
601         ccp.setSteadyPoolSize( adminPool.getSteadyPoolSize() != null ?
602         adminPool.getSteadyPoolSize() :
603         adminPool.getDefaultSteadyPoolSize() );
604
605         ccp.setMaxWaitTimeInMillis(
606         adminPool.getMaxWaitTimeInMillis() != null ?
607         adminPool.getMaxWaitTimeInMillis() :
608         adminPool.getDefaultMaxWaitTimeInMillis() );
609         
610     ccp.setPoolResizeQuantity(
611         adminPool.getPoolResizeQuantity() != null ?
612         adminPool.getPoolResizeQuantity() :
613         adminPool.getDefaultPoolResizeQuantity());
614         
615     ccp.setIdleTimeoutInSeconds(
616         adminPool.getIdleTimeoutInSeconds() != null ?
617         adminPool.getIdleTimeoutInSeconds() :
618         adminPool.getDefaultIdleTimeoutInSeconds() );
619         
620     ccp.setFailAllConnections(adminPool.isFailAllConnections());
621
622     ccp.setConnectionValidationRequired(
623         adminPool.isIsConnectionValidationRequired() );
624
625     ccp.setNonTransactional(
626             adminPool.isNonTransactionalConnections() );
627     ccp.setNonComponent( adminPool.isAllowNonComponentCallers() );
628
629         //These are default properties of all Jdbc pools
630
//So set them here first and then figure out from the parsing routine
631
//if they need to be reset
632
ccp.setMatchConnections( false );
633     ccp.setLazyConnectionAssoc( false );
634     ccp.setAssociateWithThread( false );
635     ccp.setConnectionLeakTracing( false );
636
637     }
638
639 }
640
Popular Tags