KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mchange > v2 > c3p0 > ComboPooledDataSource


1 /*
2  * Distributed as part of c3p0 v.0.9.1
3  *
4  * Copyright (C) 2005 Machinery For Change, Inc.
5  *
6  * Author: Steve Waldman <swaldman@mchange.com>
7  *
8  * This library is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License version 2.1, as
10  * published by the Free Software Foundation.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this software; see the file LICENSE. If not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */

22
23
24 package com.mchange.v2.c3p0;
25
26 import java.beans.*;
27 import java.io.*;
28 import java.sql.*;
29 import java.util.*;
30 import javax.naming.*;
31 import com.mchange.v2.log.*;
32 import com.mchange.v2.naming.*;
33 import com.mchange.v2.c3p0.impl.*;
34
35 import javax.sql.DataSource JavaDoc;
36 import com.mchange.v2.beans.BeansUtils;
37 import com.mchange.v2.c3p0.cfg.C3P0Config;
38
39 /**
40  * <p>For the meaning of most of these properties, please see c3p0's top-level documentation!</p>
41  */

42 public final class ComboPooledDataSource extends AbstractPoolBackedDataSource implements PooledDataSource, Serializable, Referenceable
43 {
44     final static MLogger logger = MLog.getLogger( ComboPooledDataSource.class );
45
46     final static Set TO_STRING_IGNORE_PROPS = new HashSet( Arrays.asList( new String JavaDoc[] {
47                     "connection",
48                     "lastCheckinFailureDefaultUser",
49                     "lastCheckoutFailureDefaultUser",
50                     "lastConnectionTestFailureDefaultUser",
51                     "lastIdleTestFailureDefaultUser",
52                     "logWriter",
53                     "loginTimeout",
54                     "numBusyConnections",
55                     "numBusyConnectionsAllUsers",
56                     "numBusyConnectionsDefaultUser",
57                     "numConnections",
58                     "numConnectionsAllUsers",
59                     "numConnectionsDefaultUser",
60                     "numFailedCheckinsDefaultUser",
61                     "numFailedCheckoutsDefaultUser",
62                     "numFailedIdleTestsDefaultUser",
63                     "numIdleConnections",
64                     "numIdleConnectionsAllUsers",
65                     "numIdleConnectionsDefaultUser",
66                     "numUnclosedOrphanedConnections",
67                     "numUnclosedOrphanedConnectionsAllUsers",
68                     "numUnclosedOrphanedConnectionsDefaultUser",
69                     "numUserPools",
70                     "effectivePropertyCycleDefaultUser",
71                     "startTimeMillisDefaultUser",
72                     "statementCacheNumCheckedOutDefaultUser",
73                     "statementCacheNumCheckedOutStatementsAllUsers",
74                     "statementCacheNumConnectionsWithCachedStatementsAllUsers",
75                     "statementCacheNumConnectionsWithCachedStatementsDefaultUser",
76                     "statementCacheNumStatementsAllUsers",
77                     "statementCacheNumStatementsDefaultUser",
78                     "threadPoolSize",
79                     "threadPoolNumActiveThreads",
80                     "threadPoolNumIdleThreads",
81                     "threadPoolNumTasksPending",
82                     "threadPoolStackTraces",
83                     "threadPoolStatus",
84                     "overrideDefaultUser",
85                     "overrideDefaultPassword",
86                     "password",
87                     "reference",
88                     "upTimeMillisDefaultUser",
89                     "user",
90                     "userOverridesAsString",
91                     "allUsers",
92                     "connectionPoolDataSource"
93     } ) );
94
95     // not reassigned post-ctor; mutable elements protected by their own locks
96
// when (very rarely) necessery, we sync this -> wcpds -> dmds
97

98     // note that serialization of these guys happens via out superclass
99
// we just have to make sure they get properly reset on deserialization
100
transient DriverManagerDataSource dmds;
101     transient WrapperConnectionPoolDataSource wcpds;
102
103     public ComboPooledDataSource()
104     { this( true ); }
105
106     public ComboPooledDataSource( boolean autoregister )
107     {
108         super( autoregister );
109
110         // System.err.println("...Initializing ComboPooledDataSource.");
111

112         dmds = new DriverManagerDataSource();
113         wcpds = new WrapperConnectionPoolDataSource();
114
115         wcpds.setNestedDataSource( dmds );
116
117         try
118         { this.setConnectionPoolDataSource( wcpds ); }
119         catch (PropertyVetoException e)
120         {
121             logger.log(MLevel.WARNING, "Hunh??? This can't happen. We haven't set up any listeners to veto the property change yet!", e);
122             throw new RuntimeException JavaDoc("Hunh??? This can't happen. We haven't set up any listeners to veto the property change yet! " + e);
123         }
124
125         // set things up in case there are future changes to our ConnectionPoolDataSource
126
//
127
setUpPropertyEvents();
128     }
129
130     private void setUpPropertyEvents()
131     {
132         VetoableChangeListener wcpdsConsistencyEnforcer = new VetoableChangeListener()
133         {
134             // always called within synchronized mutators of the parent class... needn't explicitly sync here
135
public void vetoableChange( PropertyChangeEvent evt ) throws PropertyVetoException
136             {
137                 String JavaDoc propName = evt.getPropertyName();
138                 Object JavaDoc val = evt.getNewValue();
139
140                 if ( "connectionPoolDataSource".equals( propName ) )
141                 {
142                     if (val instanceof WrapperConnectionPoolDataSource)
143                     {
144                         DataSource JavaDoc nested = (DataSource JavaDoc) ((WrapperConnectionPoolDataSource)val).getNestedDataSource();
145                         if (! (nested instanceof DriverManagerDataSource) )
146                             throw new PropertyVetoException("ComboPooledDataSource requires that its unpooled DataSource " +
147                                             " be set at all times, and that it be a" +
148                                             " com.mchange.v2.c3p0.DriverManagerDataSource. Bad: " + nested, evt);
149                     }
150                     else
151                         throw new PropertyVetoException("ComboPooledDataSource requires that its ConnectionPoolDataSource " +
152                                         " be set at all times, and that it be a" +
153                                         " com.mchange.v2.c3p0.WrapperConnectionPoolDataSource. Bad: " + val, evt);
154                 }
155             }
156         };
157         this.addVetoableChangeListener( wcpdsConsistencyEnforcer );
158
159         PropertyChangeListener wcpdsStateUpdater = new PropertyChangeListener()
160         {
161             public void propertyChange( PropertyChangeEvent evt )
162             { updateLocalVarsFromCpdsProp(); }
163         };
164         this.addPropertyChangeListener( wcpdsStateUpdater );
165     }
166
167     private void updateLocalVarsFromCpdsProp()
168     {
169         this.wcpds = (WrapperConnectionPoolDataSource) this.getConnectionPoolDataSource();
170         this.dmds = (DriverManagerDataSource) wcpds.getNestedDataSource();
171     }
172
173     public ComboPooledDataSource(String JavaDoc configName)
174     {
175         this();
176         initializeNamedConfig( configName );
177     }
178
179 // // workaround sun big id #6342411 (in which reflective
180
// // access to a public method of a non-public class fails,
181
// // even if the non-public class is accessed via a public
182
// // subclass)
183
// public String getDataSourceName()
184
// { return super.getDataSourceName(); }
185

186     // DriverManagerDataSourceProperties (count: 4)
187
public String JavaDoc getDescription()
188     { return dmds.getDescription(); }
189
190     public void setDescription( String JavaDoc description )
191     { dmds.setDescription( description ); }
192
193     public String JavaDoc getDriverClass()
194     { return dmds.getDriverClass(); }
195
196     public void setDriverClass( String JavaDoc driverClass ) throws PropertyVetoException
197     {
198         dmds.setDriverClass( driverClass );
199 // System.err.println("setting driverClass: " + driverClass);
200
}
201
202     public String JavaDoc getJdbcUrl()
203     {
204 // System.err.println("getting jdbcUrl: " + dmds.getJdbcUrl());
205
return dmds.getJdbcUrl();
206     }
207
208     public void setJdbcUrl( String JavaDoc jdbcUrl )
209     {
210         dmds.setJdbcUrl( jdbcUrl );
211         this.resetPoolManager( false );
212 // System.err.println("setting jdbcUrl: " + jdbcUrl + " [dmds@" + C3P0ImplUtils.identityToken( dmds ) + "]");
213
// if (jdbcUrl == null)
214
// new Exception("*** NULL SETTER ***").printStackTrace();
215
}
216
217     public Properties getProperties()
218     {
219         //System.err.println("getting properties: " + dmds.getProperties());
220
return dmds.getProperties();
221     }
222
223     public void setProperties( Properties properties )
224     {
225         //System.err.println("setting properties: " + properties);
226
dmds.setProperties( properties );
227         this.resetPoolManager(false);
228     }
229
230     // DriverManagerDataSource "virtual properties" based on properties
231
public String JavaDoc getUser()
232     { return dmds.getUser(); }
233
234     public void setUser( String JavaDoc user )
235     {
236         dmds.setUser( user );
237         this.resetPoolManager( false );
238     }
239
240     public String JavaDoc getPassword()
241     { return dmds.getPassword(); }
242
243     public void setPassword( String JavaDoc password )
244     {
245         dmds.setPassword( password );
246         this.resetPoolManager( false );
247     }
248
249     // WrapperConnectionPoolDataSource properties
250
public int getCheckoutTimeout()
251     { return wcpds.getCheckoutTimeout(); }
252
253     public void setCheckoutTimeout( int checkoutTimeout )
254     {
255         wcpds.setCheckoutTimeout( checkoutTimeout );
256         this.resetPoolManager( false );
257     }
258
259     public int getAcquireIncrement()
260     { return wcpds.getAcquireIncrement(); }
261
262     public void setAcquireIncrement( int acquireIncrement )
263     {
264         wcpds.setAcquireIncrement( acquireIncrement );
265         this.resetPoolManager( false );
266     }
267
268     public int getAcquireRetryAttempts()
269     { return wcpds.getAcquireRetryAttempts(); }
270
271     public void setAcquireRetryAttempts( int acquireRetryAttempts )
272     {
273         wcpds.setAcquireRetryAttempts( acquireRetryAttempts );
274         this.resetPoolManager( false );
275     }
276
277     public int getAcquireRetryDelay()
278     { return wcpds.getAcquireRetryDelay(); }
279
280     public void setAcquireRetryDelay( int acquireRetryDelay )
281     {
282         wcpds.setAcquireRetryDelay( acquireRetryDelay );
283         this.resetPoolManager( false );
284     }
285
286     public boolean isAutoCommitOnClose()
287     { return wcpds.isAutoCommitOnClose(); }
288
289     public void setAutoCommitOnClose( boolean autoCommitOnClose )
290     {
291         wcpds.setAutoCommitOnClose( autoCommitOnClose );
292         this.resetPoolManager( false );
293     }
294
295     public String JavaDoc getConnectionTesterClassName()
296     { return wcpds.getConnectionTesterClassName(); }
297
298     public void setConnectionTesterClassName( String JavaDoc connectionTesterClassName ) throws PropertyVetoException
299     {
300         wcpds.setConnectionTesterClassName( connectionTesterClassName );
301         this.resetPoolManager( false );
302     }
303
304     public String JavaDoc getAutomaticTestTable()
305     { return wcpds.getAutomaticTestTable(); }
306
307     public void setAutomaticTestTable( String JavaDoc automaticTestTable )
308     {
309         wcpds.setAutomaticTestTable( automaticTestTable );
310         this.resetPoolManager( false );
311     }
312
313     public boolean isForceIgnoreUnresolvedTransactions()
314     { return wcpds.isForceIgnoreUnresolvedTransactions(); }
315
316     public void setForceIgnoreUnresolvedTransactions( boolean forceIgnoreUnresolvedTransactions )
317     {
318         wcpds.setForceIgnoreUnresolvedTransactions( forceIgnoreUnresolvedTransactions );
319         this.resetPoolManager( false );
320     }
321
322     public int getIdleConnectionTestPeriod()
323     { return wcpds.getIdleConnectionTestPeriod(); }
324
325     public void setIdleConnectionTestPeriod( int idleConnectionTestPeriod )
326     {
327         wcpds.setIdleConnectionTestPeriod( idleConnectionTestPeriod );
328         this.resetPoolManager( false );
329     }
330
331     public int getInitialPoolSize()
332     { return wcpds.getInitialPoolSize(); }
333
334     public void setInitialPoolSize( int initialPoolSize )
335     {
336         wcpds.setInitialPoolSize( initialPoolSize );
337         this.resetPoolManager( false );
338     }
339
340     public int getMaxIdleTime()
341     { return wcpds.getMaxIdleTime(); }
342
343     public void setMaxIdleTime( int maxIdleTime )
344     {
345         wcpds.setMaxIdleTime( maxIdleTime );
346         this.resetPoolManager( false );
347     }
348
349     public int getMaxPoolSize()
350     { return wcpds.getMaxPoolSize(); }
351
352     public void setMaxPoolSize( int maxPoolSize )
353     {
354         wcpds.setMaxPoolSize( maxPoolSize );
355         this.resetPoolManager( false );
356     }
357
358     public int getMaxStatements()
359     { return wcpds.getMaxStatements(); }
360
361     public void setMaxStatements( int maxStatements )
362     {
363         wcpds.setMaxStatements( maxStatements );
364         this.resetPoolManager( false );
365     }
366
367     public int getMaxStatementsPerConnection()
368     { return wcpds.getMaxStatementsPerConnection(); }
369
370     public void setMaxStatementsPerConnection( int maxStatementsPerConnection )
371     {
372         wcpds.setMaxStatementsPerConnection( maxStatementsPerConnection );
373         this.resetPoolManager( false );
374     }
375
376     public int getMinPoolSize()
377     { return wcpds.getMinPoolSize(); }
378
379     public void setMinPoolSize( int minPoolSize )
380     {
381         wcpds.setMinPoolSize( minPoolSize );
382         this.resetPoolManager( false );
383     }
384
385     public String JavaDoc getOverrideDefaultUser()
386     { return wcpds.getOverrideDefaultUser(); }
387
388     public void setOverrideDefaultUser(String JavaDoc overrideDefaultUser)
389     {
390         wcpds.setOverrideDefaultUser( overrideDefaultUser );
391         this.resetPoolManager( false );
392     }
393
394     public String JavaDoc getOverrideDefaultPassword()
395     { return wcpds.getOverrideDefaultPassword(); }
396
397     public void setOverrideDefaultPassword(String JavaDoc overrideDefaultPassword)
398     {
399         wcpds.setOverrideDefaultPassword( overrideDefaultPassword );
400         this.resetPoolManager( false );
401     }
402
403     public int getPropertyCycle()
404     { return wcpds.getPropertyCycle(); }
405
406     public void setPropertyCycle( int propertyCycle )
407     {
408         wcpds.setPropertyCycle( propertyCycle );
409         this.resetPoolManager( false );
410     }
411
412     public boolean isBreakAfterAcquireFailure()
413     { return wcpds.isBreakAfterAcquireFailure(); }
414
415     public void setBreakAfterAcquireFailure( boolean breakAfterAcquireFailure )
416     {
417         wcpds.setBreakAfterAcquireFailure( breakAfterAcquireFailure );
418         this.resetPoolManager( false );
419     }
420
421     public boolean isTestConnectionOnCheckout()
422     { return wcpds.isTestConnectionOnCheckout(); }
423
424     public void setTestConnectionOnCheckout( boolean testConnectionOnCheckout )
425     {
426         wcpds.setTestConnectionOnCheckout( testConnectionOnCheckout );
427         this.resetPoolManager( false );
428     }
429
430     public boolean isTestConnectionOnCheckin()
431     { return wcpds.isTestConnectionOnCheckin(); }
432
433     public void setTestConnectionOnCheckin( boolean testConnectionOnCheckin )
434     {
435         wcpds.setTestConnectionOnCheckin( testConnectionOnCheckin );
436         this.resetPoolManager( false );
437     }
438
439     public boolean isUsesTraditionalReflectiveProxies()
440     { return wcpds.isUsesTraditionalReflectiveProxies(); }
441
442     public void setUsesTraditionalReflectiveProxies( boolean usesTraditionalReflectiveProxies )
443     {
444         wcpds.setUsesTraditionalReflectiveProxies( usesTraditionalReflectiveProxies );
445         this.resetPoolManager( false );
446     }
447
448     public String JavaDoc getPreferredTestQuery()
449     { return wcpds.getPreferredTestQuery(); }
450
451     public void setPreferredTestQuery( String JavaDoc preferredTestQuery )
452     {
453         wcpds.setPreferredTestQuery( preferredTestQuery );
454         this.resetPoolManager( false );
455     }
456
457     public String JavaDoc getUserOverridesAsString()
458     { return wcpds.getUserOverridesAsString(); }
459
460     public void setUserOverridesAsString( String JavaDoc userOverridesAsString ) throws PropertyVetoException
461     {
462         wcpds.setUserOverridesAsString( userOverridesAsString );
463         this.resetPoolManager( false );
464     }
465
466     public int getMaxAdministrativeTaskTime()
467     { return wcpds.getMaxAdministrativeTaskTime(); }
468
469     public void setMaxAdministrativeTaskTime( int maxAdministrativeTaskTime )
470     {
471         wcpds.setMaxAdministrativeTaskTime( maxAdministrativeTaskTime );
472         this.resetPoolManager( false );
473     }
474
475     public int getMaxIdleTimeExcessConnections()
476     { return wcpds.getMaxIdleTimeExcessConnections(); }
477
478     public void setMaxIdleTimeExcessConnections( int maxIdleTimeExcessConnections )
479     {
480         wcpds.setMaxIdleTimeExcessConnections( maxIdleTimeExcessConnections );
481         this.resetPoolManager( false );
482     }
483
484     public int getMaxConnectionAge()
485     { return wcpds.getMaxConnectionAge(); }
486
487     public void setMaxConnectionAge( int maxConnectionAge )
488     {
489         wcpds.setMaxConnectionAge( maxConnectionAge );
490         this.resetPoolManager( false );
491     }
492
493     public String JavaDoc getConnectionCustomizerClassName()
494     { return wcpds.getConnectionCustomizerClassName(); }
495
496     public void setConnectionCustomizerClassName( String JavaDoc connectionCustomizerClassName )
497     {
498         wcpds.setConnectionCustomizerClassName( connectionCustomizerClassName );
499         this.resetPoolManager( false );
500     }
501
502     public int getUnreturnedConnectionTimeout()
503     { return wcpds.getUnreturnedConnectionTimeout(); }
504
505     public void setUnreturnedConnectionTimeout(int unreturnedConnectionTimeout)
506     {
507         wcpds.setUnreturnedConnectionTimeout( unreturnedConnectionTimeout );
508         this.resetPoolManager( false );
509     }
510
511     public boolean isDebugUnreturnedConnectionStackTraces()
512     { return wcpds.isDebugUnreturnedConnectionStackTraces(); }
513
514     public void setDebugUnreturnedConnectionStackTraces(boolean debugUnreturnedConnectionStackTraces)
515     {
516         wcpds.setDebugUnreturnedConnectionStackTraces( debugUnreturnedConnectionStackTraces );
517         this.resetPoolManager( false );
518     }
519
520     // shared properties (count: 1)
521
public String JavaDoc getFactoryClassLocation()
522     { return super.getFactoryClassLocation(); }
523
524     public void setFactoryClassLocation( String JavaDoc factoryClassLocation )
525     {
526         dmds.setFactoryClassLocation( factoryClassLocation );
527         wcpds.setFactoryClassLocation( factoryClassLocation );
528         super.setFactoryClassLocation( factoryClassLocation );
529     }
530
531     public String JavaDoc toString()
532     {
533         //System.err.println("ComboPooledDataSource.toString()");
534

535         StringBuffer JavaDoc sb = new StringBuffer JavaDoc(512);
536         sb.append( this.getClass().getName() );
537         sb.append(" [ ");
538         try { BeansUtils.appendPropNamesAndValues(sb, this, TO_STRING_IGNORE_PROPS); }
539         catch (Exception JavaDoc e)
540         {
541             sb.append( e.toString() );
542             //e.printStackTrace();
543
}
544         sb.append(" ]");
545
546 // Map userOverrides = wcpds.getUserOverrides();
547
// if (userOverrides != null)
548
// sb.append("; userOverrides: " + userOverrides.toString());
549

550         return sb.toString();
551     }
552
553     // serialization stuff -- set up bound/constrained property event handlers on deserialization
554
private static final long serialVersionUID = 1;
555     private static final short VERSION = 0x0001;
556
557     private void writeObject( ObjectOutputStream oos ) throws IOException
558     {
559         oos.writeShort( VERSION );
560     }
561
562     private void readObject( ObjectInputStream ois ) throws IOException, ClassNotFoundException JavaDoc
563     {
564         short version = ois.readShort();
565         switch (version)
566         {
567         case VERSION:
568             updateLocalVarsFromCpdsProp();
569             setUpPropertyEvents();
570             break;
571         default:
572             throw new IOException("Unsupported Serialized Version: " + version);
573         }
574     }
575 }
576
577 //now, referenceability happens exactly the same way it does for PoolBackedDataSource
578
//all this stuff (and the maintenance hassle of it) should be unnecessary
579

580 /*
581  // WrapperConnectionPoolDataSource properties -- count: 28
582 //
583 // ("checkoutTimeout");
584 // ("acquireIncrement");
585 // ("acquireRetryAttempts");
586 // ("acquireRetryDelay");
587 // ("autoCommitOnClose");
588 // ("connectionTesterClassName");
589 // ("forceIgnoreUnresolvedTransactions");
590 // ("idleConnectionTestPeriod");
591 // ("initialPoolSize");
592 // ("maxIdleTime");
593 // ("maxPoolSize");
594 // ("maxStatements");
595 // ("maxStatementsPerConnection");
596 // ("minPoolSize");
597 // ("propertyCycle");
598 // ("breakAfterAcquireFailure");
599 // ("testConnectionOnCheckout");
600 // ("testConnectionOnCheckin");
601 // ("usesTraditionalReflectiveProxies");
602 // ("preferredTestQuery");
603 // ("automaticTestTable");
604 // ("userOverridesAsString");
605 // ("overrideDefaultUser");
606 // ("overrideDefaultPassword");
607 // ("maxAdministrativeTaskTime");
608 // ("maxIdleTimeExcessConnections");
609 // ("maxConnectionAge");
610 // ("connectionTesterClassName");
611
612    final static JavaBeanReferenceMaker referenceMaker = new JavaBeanReferenceMaker();
613
614     static
615     {
616     referenceMaker.setFactoryClassName( C3P0JavaBeanObjectFactory.class.getName() );
617
618     // DriverManagerDataSource properties (count: 4)
619     referenceMaker.addReferenceProperty("description");
620     referenceMaker.addReferenceProperty("driverClass");
621     referenceMaker.addReferenceProperty("jdbcUrl");
622     referenceMaker.addReferenceProperty("properties");
623
624     // WrapperConnectionPoolDataSource properties (count: 27)
625     referenceMaker.addReferenceProperty("checkoutTimeout");
626     referenceMaker.addReferenceProperty("acquireIncrement");
627     referenceMaker.addReferenceProperty("acquireRetryAttempts");
628     referenceMaker.addReferenceProperty("acquireRetryDelay");
629     referenceMaker.addReferenceProperty("autoCommitOnClose");
630     referenceMaker.addReferenceProperty("connectionTesterClassName");
631     referenceMaker.addReferenceProperty("forceIgnoreUnresolvedTransactions");
632     referenceMaker.addReferenceProperty("idleConnectionTestPeriod");
633     referenceMaker.addReferenceProperty("initialPoolSize");
634     referenceMaker.addReferenceProperty("maxIdleTime");
635     referenceMaker.addReferenceProperty("maxPoolSize");
636     referenceMaker.addReferenceProperty("maxStatements");
637     referenceMaker.addReferenceProperty("maxStatementsPerConnection");
638     referenceMaker.addReferenceProperty("minPoolSize");
639     referenceMaker.addReferenceProperty("propertyCycle");
640     referenceMaker.addReferenceProperty("breakAfterAcquireFailure");
641     referenceMaker.addReferenceProperty("testConnectionOnCheckout");
642     referenceMaker.addReferenceProperty("testConnectionOnCheckin");
643     referenceMaker.addReferenceProperty("usesTraditionalReflectiveProxies");
644     referenceMaker.addReferenceProperty("preferredTestQuery");
645     referenceMaker.addReferenceProperty("automaticTestTable");
646     referenceMaker.addReferenceProperty("userOverridesAsString");
647     referenceMaker.addReferenceProperty("overrideDefaultUser");
648     referenceMaker.addReferenceProperty("overrideDefaultPassword");
649     referenceMaker.addReferenceProperty("maxAdministrativeTaskTime");
650     referenceMaker.addReferenceProperty("maxIdleTimeExcessConnections");
651     referenceMaker.addReferenceProperty("maxConnectionAge");
652
653     // PoolBackedDataSource properties (count: 2)
654     referenceMaker.addReferenceProperty("dataSourceName");
655     referenceMaker.addReferenceProperty("numHelperThreads");
656
657     // identity token
658     referenceMaker.addReferenceProperty("identityToken");
659
660     // shared properties (count: 1)
661     referenceMaker.addReferenceProperty("factoryClassLocation");
662     }
663
664     public Reference getReference() throws NamingException
665     {
666     synchronized ( this )
667         {
668         synchronized ( wcpds )
669             {
670             synchronized( dmds )
671                 {
672                 //System.err.println("ComboPooledDataSource.getReference()!!!!");
673                 //new Exception("PRINT-STACK-TRACE").printStackTrace();
674                 //javax.naming.Reference out = referenceMaker.createReference( this );
675                 //System.err.println(out);
676                 //return out;
677
678                 return referenceMaker.createReference( this );
679                 }
680             }
681         }
682     }
683  */

684
Popular Tags