[SDNC-5] Rebase sdnc-core
[sdnc/core.git] / dblib / common / src / main / java / org / apache / tomcat / jdbc / pool / jmx / ConnectionPool.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * openecomp
4  * ================================================================================
5  * Copyright (C) 2016 - 2017 AT&T
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 /* Licensed to the Apache Software Foundation (ASF) under one or more
22  * contributor license agreements.  See the NOTICE file distributed with
23  * this work for additional information regarding copyright ownership.
24  * The ASF licenses this file to You under the Apache License, Version 2.0
25  * (the "License"); you may not use this file except in compliance with
26  * the License.  You may obtain a copy of the License at
27  *
28  *      http://www.apache.org/licenses/LICENSE-2.0
29  *
30  * Unless required by applicable law or agreed to in writing, software
31  * distributed under the License is distributed on an "AS IS" BASIS,
32  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33  * See the License for the specific language governing permissions and
34  * limitations under the License.
35  */
36 package org.apache.tomcat.jdbc.pool.jmx;
37
38 import java.util.Properties;
39 import java.util.concurrent.ConcurrentLinkedQueue;
40 import java.util.concurrent.atomic.AtomicInteger;
41
42 import javax.management.MBeanNotificationInfo;
43 import javax.management.Notification;
44 import javax.management.NotificationBroadcasterSupport;
45 import javax.management.NotificationListener;
46
47 import org.apache.juli.logging.Log;
48 import org.apache.juli.logging.LogFactory;
49 import org.apache.tomcat.jdbc.pool.PoolConfiguration;
50 import org.apache.tomcat.jdbc.pool.PoolProperties.InterceptorDefinition;
51 import org.apache.tomcat.jdbc.pool.PoolUtilities;
52 import org.apache.tomcat.jdbc.pool.Validator;
53
54 public class ConnectionPool extends NotificationBroadcasterSupport implements ConnectionPoolMBean  {
55     /**
56      * logger
57      */
58     private static final Log log = LogFactory.getLog(ConnectionPool.class);
59
60     /**
61      * the connection pool
62      */
63     protected org.apache.tomcat.jdbc.pool.ConnectionPool pool = null;
64     /**
65      * sequence for JMX notifications
66      */
67     protected AtomicInteger sequence = new AtomicInteger(0);
68
69     /**
70      * Listeners that are local and interested in our notifications, no need for JMX
71      */
72     protected ConcurrentLinkedQueue<NotificationListener> listeners =
73             new ConcurrentLinkedQueue<>();
74
75     public ConnectionPool(org.apache.tomcat.jdbc.pool.ConnectionPool pool) {
76         super();
77         this.pool = pool;
78     }
79
80     public org.apache.tomcat.jdbc.pool.ConnectionPool getPool() {
81         return pool;
82     }
83
84     public PoolConfiguration getPoolProperties() {
85         return pool.getPoolProperties();
86     }
87
88     //=================================================================
89     //       NOTIFICATION INFO
90     //=================================================================
91     public static final String NOTIFY_INIT = "INIT FAILED";
92     public static final String NOTIFY_CONNECT = "CONNECTION FAILED";
93     public static final String NOTIFY_ABANDON = "CONNECTION ABANDONED";
94     public static final String SLOW_QUERY_NOTIFICATION = "SLOW QUERY";
95     public static final String FAILED_QUERY_NOTIFICATION = "FAILED QUERY";
96     public static final String SUSPECT_ABANDONED_NOTIFICATION = "SUSPECT CONNECTION ABANDONED";
97     public static final String POOL_EMPTY = "POOL EMPTY";
98     public static final String SUSPECT_RETURNED_NOTIFICATION = "SUSPECT CONNECTION RETURNED";
99
100     @Override
101     public MBeanNotificationInfo[] getNotificationInfo() {
102         MBeanNotificationInfo[] pres = super.getNotificationInfo();
103         MBeanNotificationInfo[] loc = getDefaultNotificationInfo();
104         MBeanNotificationInfo[] aug = new MBeanNotificationInfo[pres.length + loc.length];
105         if (pres.length>0) System.arraycopy(pres, 0, aug, 0, pres.length);
106         if (loc.length >0) System.arraycopy(loc, 0, aug, pres.length, loc.length);
107         return aug;
108     }
109
110     public static MBeanNotificationInfo[] getDefaultNotificationInfo() {
111         String[] types = new String[] {NOTIFY_INIT, NOTIFY_CONNECT, NOTIFY_ABANDON, SLOW_QUERY_NOTIFICATION,
112                 FAILED_QUERY_NOTIFICATION, SUSPECT_ABANDONED_NOTIFICATION, POOL_EMPTY, SUSPECT_RETURNED_NOTIFICATION};
113         String name = Notification.class.getName();
114         String description = "A connection pool error condition was met.";
115         MBeanNotificationInfo info = new MBeanNotificationInfo(types, name, description);
116         return new MBeanNotificationInfo[] {info};
117     }
118
119     /**
120      * Return true if the notification was sent successfully, false otherwise.
121      * @param type The notification type
122      * @param message The message
123      * @return true if the notification succeeded
124      */
125     public boolean notify(final String type, String message) {
126         try {
127             Notification n = new Notification(
128                     type,
129                     this,
130                     sequence.incrementAndGet(),
131                     System.currentTimeMillis(),
132                     "["+type+"] "+message);
133             sendNotification(n);
134             for (NotificationListener listener : listeners) {
135                 listener.handleNotification(n,this);
136             }
137             return true;
138         }catch (Exception x) {
139             if (log.isDebugEnabled()) {
140                 log.debug("Notify failed. Type="+type+"; Message="+message,x);
141             }
142             return false;
143         }
144
145     }
146
147     public void addListener(NotificationListener list) {
148         listeners.add(list);
149     }
150
151     public boolean removeListener(NotificationListener list) {
152         return listeners.remove(list);
153     }
154
155     //=================================================================
156     //       POOL STATS
157     //=================================================================
158
159     @Override
160     public int getSize() {
161         return pool.getSize();
162     }
163
164     @Override
165     public int getIdle() {
166         return pool.getIdle();
167     }
168
169     @Override
170     public int getActive() {
171         return pool.getActive();
172     }
173
174     @Override
175     public int getNumIdle() {
176         return getIdle();
177     }
178
179     @Override
180     public int getNumActive() {
181         return getActive();
182     }
183
184     @Override
185     public int getWaitCount() {
186         return pool.getWaitCount();
187     }
188
189     @Override
190     public long getBorrowedCount() {
191         return pool.getBorrowedCount();
192     }
193
194     @Override
195     public long getReturnedCount() {
196         return pool.getReturnedCount();
197     }
198
199     @Override
200     public long getCreatedCount() {
201         return pool.getCreatedCount();
202     }
203
204     @Override
205     public long getReleasedCount() {
206         return pool.getReleasedCount();
207     }
208
209     @Override
210     public long getReconnectedCount() {
211         return pool.getReconnectedCount();
212     }
213
214     @Override
215     public long getRemoveAbandonedCount() {
216         return pool.getRemoveAbandonedCount();
217     }
218
219     @Override
220     public long getReleasedIdleCount() {
221         return pool.getReleasedIdleCount();
222     }
223
224     //=================================================================
225     //       POOL OPERATIONS
226     //=================================================================
227     @Override
228     public void checkIdle() {
229         pool.checkIdle();
230     }
231
232     @Override
233     public void checkAbandoned() {
234         pool.checkAbandoned();
235     }
236
237     @Override
238     public void testIdle() {
239         pool.testAllIdle();
240     }
241
242     @Override
243     public void resetStats() {
244         pool.resetStats();
245     }
246
247     //=================================================================
248     //       POOL PROPERTIES
249     //=================================================================
250     //=========================================================
251     //  PROPERTIES / CONFIGURATION
252     //=========================================================
253
254
255     @Override
256     public String getConnectionProperties() {
257         return getPoolProperties().getConnectionProperties();
258     }
259
260     @Override
261     public Properties getDbProperties() {
262         return PoolUtilities.cloneWithoutPassword(getPoolProperties().getDbProperties());
263     }
264
265     @Override
266     public String getDefaultCatalog() {
267         return getPoolProperties().getDefaultCatalog();
268     }
269
270     @Override
271     public int getDefaultTransactionIsolation() {
272         return getPoolProperties().getDefaultTransactionIsolation();
273     }
274
275     @Override
276     public String getDriverClassName() {
277         return getPoolProperties().getDriverClassName();
278     }
279
280
281     @Override
282     public int getInitialSize() {
283         return getPoolProperties().getInitialSize();
284     }
285
286     @Override
287     public String getInitSQL() {
288         return getPoolProperties().getInitSQL();
289     }
290
291     @Override
292     public String getJdbcInterceptors() {
293         return getPoolProperties().getJdbcInterceptors();
294     }
295
296     @Override
297     public int getMaxActive() {
298         return getPoolProperties().getMaxActive();
299     }
300
301     @Override
302     public int getMaxIdle() {
303         return getPoolProperties().getMaxIdle();
304     }
305
306     @Override
307     public int getMaxWait() {
308         return getPoolProperties().getMaxWait();
309     }
310
311     @Override
312     public int getMinEvictableIdleTimeMillis() {
313         return getPoolProperties().getMinEvictableIdleTimeMillis();
314     }
315
316     @Override
317     public int getMinIdle() {
318         return getPoolProperties().getMinIdle();
319     }
320
321     @Override
322     public long getMaxAge() {
323         return getPoolProperties().getMaxAge();
324     }
325
326     @Override
327     public String getName() {
328         return this.getPoolName();
329     }
330
331     @Override
332     public int getNumTestsPerEvictionRun() {
333         return getPoolProperties().getNumTestsPerEvictionRun();
334     }
335
336     /**
337      * @return DOES NOT RETURN THE PASSWORD, IT WOULD SHOW UP IN JMX
338      */
339     @Override
340     public String getPassword() {
341         return "Password not available as DataSource/JMX operation.";
342     }
343
344     @Override
345     public int getRemoveAbandonedTimeout() {
346         return getPoolProperties().getRemoveAbandonedTimeout();
347     }
348
349
350     @Override
351     public int getTimeBetweenEvictionRunsMillis() {
352         return getPoolProperties().getTimeBetweenEvictionRunsMillis();
353     }
354
355     @Override
356     public String getUrl() {
357         return getPoolProperties().getUrl();
358     }
359
360     @Override
361     public String getUsername() {
362         return getPoolProperties().getUsername();
363     }
364
365     @Override
366     public long getValidationInterval() {
367         return getPoolProperties().getValidationInterval();
368     }
369
370     @Override
371     public String getValidationQuery() {
372         return getPoolProperties().getValidationQuery();
373     }
374
375     @Override
376     public int getValidationQueryTimeout() {
377         return getPoolProperties().getValidationQueryTimeout();
378     }
379
380     /**
381      * {@inheritDoc}
382      */
383
384     @Override
385     public String getValidatorClassName() {
386         return getPoolProperties().getValidatorClassName();
387     }
388
389     /**
390      * {@inheritDoc}
391      */
392
393     @Override
394     public Validator getValidator() {
395         return getPoolProperties().getValidator();
396     }
397
398     @Override
399     public boolean isAccessToUnderlyingConnectionAllowed() {
400         return getPoolProperties().isAccessToUnderlyingConnectionAllowed();
401     }
402
403     @Override
404     public Boolean isDefaultAutoCommit() {
405         return getPoolProperties().isDefaultAutoCommit();
406     }
407
408     @Override
409     public Boolean isDefaultReadOnly() {
410         return getPoolProperties().isDefaultReadOnly();
411     }
412
413     @Override
414     public boolean isLogAbandoned() {
415         return getPoolProperties().isLogAbandoned();
416     }
417
418     @Override
419     public boolean isPoolSweeperEnabled() {
420         return getPoolProperties().isPoolSweeperEnabled();
421     }
422
423     @Override
424     public boolean isRemoveAbandoned() {
425         return getPoolProperties().isRemoveAbandoned();
426     }
427
428     @Override
429     public int getAbandonWhenPercentageFull() {
430         return getPoolProperties().getAbandonWhenPercentageFull();
431     }
432
433     @Override
434     public boolean isTestOnBorrow() {
435         return getPoolProperties().isTestOnBorrow();
436     }
437
438     @Override
439     public boolean isTestOnConnect() {
440         return getPoolProperties().isTestOnConnect();
441     }
442
443     @Override
444     public boolean isTestOnReturn() {
445         return getPoolProperties().isTestOnReturn();
446     }
447
448     @Override
449     public boolean isTestWhileIdle() {
450         return getPoolProperties().isTestWhileIdle();
451     }
452
453
454     @Override
455     public Boolean getDefaultAutoCommit() {
456         return getPoolProperties().getDefaultAutoCommit();
457     }
458
459     @Override
460     public Boolean getDefaultReadOnly() {
461         return getPoolProperties().getDefaultReadOnly();
462     }
463
464     @Override
465     public InterceptorDefinition[] getJdbcInterceptorsAsArray() {
466         return getPoolProperties().getJdbcInterceptorsAsArray();
467     }
468
469     @Override
470     public boolean getUseLock() {
471         return getPoolProperties().getUseLock();
472     }
473
474     @Override
475     public boolean isFairQueue() {
476         return getPoolProperties().isFairQueue();
477     }
478
479     @Override
480     public boolean isJmxEnabled() {
481         return getPoolProperties().isJmxEnabled();
482     }
483
484     @Override
485     public boolean isUseEquals() {
486         return getPoolProperties().isUseEquals();
487     }
488
489     @Override
490     public void setAbandonWhenPercentageFull(int percentage) {
491         getPoolProperties().setAbandonWhenPercentageFull(percentage);
492     }
493
494     @Override
495     public void setAccessToUnderlyingConnectionAllowed(boolean accessToUnderlyingConnectionAllowed) {
496         getPoolProperties().setAccessToUnderlyingConnectionAllowed(accessToUnderlyingConnectionAllowed);
497     }
498
499     @Override
500     public void setDbProperties(Properties dbProperties) {
501         getPoolProperties().setDbProperties(dbProperties);
502     }
503
504     @Override
505     public void setDefaultReadOnly(Boolean defaultReadOnly) {
506         getPoolProperties().setDefaultReadOnly(defaultReadOnly);
507     }
508
509     @Override
510     public void setMaxAge(long maxAge) {
511         getPoolProperties().setMaxAge(maxAge);
512     }
513
514     @Override
515     public void setName(String name) {
516         getPoolProperties().setName(name);
517     }
518
519     @Override
520     public String getPoolName() {
521         return getPoolProperties().getName();
522     }
523
524
525     @Override
526     public void setConnectionProperties(String connectionProperties) {
527         getPoolProperties().setConnectionProperties(connectionProperties);
528
529     }
530
531     @Override
532     public void setDefaultAutoCommit(Boolean defaultAutoCommit) {
533         getPoolProperties().setDefaultAutoCommit(defaultAutoCommit);
534     }
535
536     @Override
537     public void setDefaultCatalog(String defaultCatalog) {
538         getPoolProperties().setDefaultCatalog(defaultCatalog);
539     }
540
541     @Override
542     public void setDefaultTransactionIsolation(int defaultTransactionIsolation) {
543         getPoolProperties().setDefaultTransactionIsolation(defaultTransactionIsolation);
544     }
545
546     @Override
547     public void setDriverClassName(String driverClassName) {
548         getPoolProperties().setDriverClassName(driverClassName);
549     }
550
551
552     @Override
553     public void setFairQueue(boolean fairQueue) {
554         // noop - this pool is already running
555         throw new UnsupportedOperationException();
556     }
557
558
559     @Override
560     public void setInitialSize(int initialSize) {
561         // noop - this pool is already running
562         throw new UnsupportedOperationException();
563
564     }
565
566
567     @Override
568     public void setInitSQL(String initSQL) {
569         getPoolProperties().setInitSQL(initSQL);
570
571     }
572
573
574     @Override
575     public void setJdbcInterceptors(String jdbcInterceptors) {
576         // noop - this pool is already running
577         throw new UnsupportedOperationException();
578     }
579
580
581     @Override
582     public void setJmxEnabled(boolean jmxEnabled) {
583         // noop - this pool is already running and obviously jmx enabled
584         throw new UnsupportedOperationException();
585     }
586
587
588     @Override
589     public void setLogAbandoned(boolean logAbandoned) {
590         getPoolProperties().setLogAbandoned(logAbandoned);
591     }
592
593
594     @Override
595     public void setMaxActive(int maxActive) {
596         getPoolProperties().setMaxActive(maxActive);
597         //make sure the pool is properly configured
598         pool.checkPoolConfiguration(getPoolProperties());
599     }
600
601
602     @Override
603     public void setMaxIdle(int maxIdle) {
604         getPoolProperties().setMaxIdle(maxIdle);
605         //make sure the pool is properly configured
606         pool.checkPoolConfiguration(getPoolProperties());
607
608     }
609
610
611     @Override
612     public void setMaxWait(int maxWait) {
613         getPoolProperties().setMaxWait(maxWait);
614     }
615
616
617     @Override
618     public void setMinEvictableIdleTimeMillis(int minEvictableIdleTimeMillis) {
619         boolean wasEnabled = getPoolProperties().isPoolSweeperEnabled();
620         getPoolProperties().setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
621         boolean shouldBeEnabled = getPoolProperties().isPoolSweeperEnabled();
622         //make sure pool cleaner starts/stops when it should
623         if (!wasEnabled && shouldBeEnabled) pool.initializePoolCleaner(getPoolProperties());
624         else if (wasEnabled && !shouldBeEnabled) pool.terminatePoolCleaner();
625     }
626
627
628     @Override
629     public void setMinIdle(int minIdle) {
630         getPoolProperties().setMinIdle(minIdle);
631         //make sure the pool is properly configured
632         pool.checkPoolConfiguration(getPoolProperties());
633     }
634
635
636     @Override
637     public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun) {
638         getPoolProperties().setNumTestsPerEvictionRun(numTestsPerEvictionRun);
639     }
640
641
642     @Override
643     public void setPassword(String password) {
644         getPoolProperties().setPassword(password);
645     }
646
647
648     @Override
649     public void setRemoveAbandoned(boolean removeAbandoned) {
650         boolean wasEnabled = getPoolProperties().isPoolSweeperEnabled();
651         getPoolProperties().setRemoveAbandoned(removeAbandoned);
652         boolean shouldBeEnabled = getPoolProperties().isPoolSweeperEnabled();
653         //make sure pool cleaner starts/stops when it should
654         if (!wasEnabled && shouldBeEnabled) pool.initializePoolCleaner(getPoolProperties());
655         else if (wasEnabled && !shouldBeEnabled) pool.terminatePoolCleaner();
656     }
657
658
659     @Override
660     public void setRemoveAbandonedTimeout(int removeAbandonedTimeout) {
661         boolean wasEnabled = getPoolProperties().isPoolSweeperEnabled();
662         getPoolProperties().setRemoveAbandonedTimeout(removeAbandonedTimeout);
663         boolean shouldBeEnabled = getPoolProperties().isPoolSweeperEnabled();
664         //make sure pool cleaner starts/stops when it should
665         if (!wasEnabled && shouldBeEnabled) pool.initializePoolCleaner(getPoolProperties());
666         else if (wasEnabled && !shouldBeEnabled) pool.terminatePoolCleaner();
667     }
668
669
670     @Override
671     public void setTestOnBorrow(boolean testOnBorrow) {
672         getPoolProperties().setTestOnBorrow(testOnBorrow);
673     }
674
675
676     @Override
677     public void setTestOnConnect(boolean testOnConnect) {
678         getPoolProperties().setTestOnConnect(testOnConnect);
679     }
680
681
682     @Override
683     public void setTestOnReturn(boolean testOnReturn) {
684         getPoolProperties().setTestOnReturn(testOnReturn);
685     }
686
687
688     @Override
689     public void setTestWhileIdle(boolean testWhileIdle) {
690         boolean wasEnabled = getPoolProperties().isPoolSweeperEnabled();
691         getPoolProperties().setTestWhileIdle(testWhileIdle);
692         boolean shouldBeEnabled = getPoolProperties().isPoolSweeperEnabled();
693         //make sure pool cleaner starts/stops when it should
694         if (!wasEnabled && shouldBeEnabled) pool.initializePoolCleaner(getPoolProperties());
695         else if (wasEnabled && !shouldBeEnabled) pool.terminatePoolCleaner();
696     }
697
698
699     @Override
700     public void setTimeBetweenEvictionRunsMillis(int timeBetweenEvictionRunsMillis) {
701         boolean wasEnabled = getPoolProperties().isPoolSweeperEnabled();
702         getPoolProperties().setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
703         boolean shouldBeEnabled = getPoolProperties().isPoolSweeperEnabled();
704         //make sure pool cleaner starts/stops when it should
705         if (!wasEnabled && shouldBeEnabled) {
706             pool.initializePoolCleaner(getPoolProperties());
707         } else if (wasEnabled) {
708             pool.terminatePoolCleaner();
709             if (shouldBeEnabled) {
710                 pool.initializePoolCleaner(getPoolProperties());
711             }
712         }
713     }
714
715
716     @Override
717     public void setUrl(String url) {
718         getPoolProperties().setUrl(url);
719     }
720
721
722     @Override
723     public void setUseEquals(boolean useEquals) {
724         getPoolProperties().setUseEquals(useEquals);
725     }
726
727
728     @Override
729     public void setUseLock(boolean useLock) {
730         getPoolProperties().setUseLock(useLock);
731     }
732
733
734     @Override
735     public void setUsername(String username) {
736         getPoolProperties().setUsername(username);
737     }
738
739
740     @Override
741     public void setValidationInterval(long validationInterval) {
742         getPoolProperties().setValidationInterval(validationInterval);
743     }
744
745
746     @Override
747     public void setValidationQuery(String validationQuery) {
748         getPoolProperties().setValidationQuery(validationQuery);
749     }
750
751     @Override
752     public void setValidationQueryTimeout(int validationQueryTimeout) {
753         getPoolProperties().setValidationQueryTimeout(validationQueryTimeout);
754     }
755
756     /**
757      * {@inheritDoc}
758      */
759
760     @Override
761     public void setValidatorClassName(String className) {
762         getPoolProperties().setValidatorClassName(className);
763     }
764
765     /**
766      * {@inheritDoc}
767      */
768
769     @Override
770     public int getSuspectTimeout() {
771         return getPoolProperties().getSuspectTimeout();
772     }
773
774     /**
775      * {@inheritDoc}
776      */
777
778     @Override
779     public void setSuspectTimeout(int seconds) {
780         getPoolProperties().setSuspectTimeout(seconds);
781     }
782
783     /**
784      * {@inheritDoc}
785      */
786     @Override
787     public void setDataSource(Object ds) {
788         getPoolProperties().setDataSource(ds);
789     }
790
791     /**
792      * {@inheritDoc}
793      */
794     @Override
795     public Object getDataSource() {
796         return getPoolProperties().getDataSource();
797     }
798
799
800     /**
801      * {@inheritDoc}
802      */
803     @Override
804     public void setDataSourceJNDI(String jndiDS) {
805         getPoolProperties().setDataSourceJNDI(jndiDS);
806     }
807
808     /**
809      * {@inheritDoc}
810      */
811     @Override
812     public String getDataSourceJNDI() {
813         return getPoolProperties().getDataSourceJNDI();
814     }
815
816     /**
817      * {@inheritDoc}
818      */
819     @Override
820     public boolean isAlternateUsernameAllowed() {
821         return getPoolProperties().isAlternateUsernameAllowed();
822     }
823
824     /**
825      * {@inheritDoc}
826      */
827     @Override
828     public void setAlternateUsernameAllowed(boolean alternateUsernameAllowed) {
829         getPoolProperties().setAlternateUsernameAllowed(alternateUsernameAllowed);
830     }
831
832     /**
833      * {@inheritDoc}
834      */
835     @Override
836     public void setValidator(Validator validator) {
837         getPoolProperties().setValidator(validator);
838     }
839
840     /**
841      * {@inheritDoc}
842      */
843     @Override
844     public void setCommitOnReturn(boolean commitOnReturn) {
845         getPoolProperties().setCommitOnReturn(commitOnReturn);
846     }
847
848     /**
849      * {@inheritDoc}
850      */
851     @Override
852     public boolean getCommitOnReturn() {
853         return getPoolProperties().getCommitOnReturn();
854     }
855
856     /**
857      * {@inheritDoc}
858      */
859     @Override
860     public void setRollbackOnReturn(boolean rollbackOnReturn) {
861         getPoolProperties().setRollbackOnReturn(rollbackOnReturn);
862     }
863
864     /**
865      * {@inheritDoc}
866      */
867     @Override
868     public boolean getRollbackOnReturn() {
869         return getPoolProperties().getRollbackOnReturn();
870     }
871
872     /**
873      * {@inheritDoc}
874      */
875     @Override
876     public void setUseDisposableConnectionFacade(boolean useDisposableConnectionFacade) {
877         getPoolProperties().setUseDisposableConnectionFacade(useDisposableConnectionFacade);
878     }
879
880     /**
881      * {@inheritDoc}
882      */
883     @Override
884     public boolean getUseDisposableConnectionFacade() {
885         return getPoolProperties().getUseDisposableConnectionFacade();
886     }
887
888     /**
889      * {@inheritDoc}
890      */
891     @Override
892     public void setLogValidationErrors(boolean logValidationErrors) {
893         getPoolProperties().setLogValidationErrors(logValidationErrors);
894     }
895
896     /**
897      * {@inheritDoc}
898      */
899     @Override
900     public boolean getLogValidationErrors() {
901         return getPoolProperties().getLogValidationErrors();
902     }
903
904
905     /**
906      * {@inheritDoc}
907      */
908     @Override
909     public boolean getPropagateInterruptState() {
910         return getPoolProperties().getPropagateInterruptState();
911     }
912
913     /**
914      * {@inheritDoc}
915      */
916     @Override
917     public void setPropagateInterruptState(boolean propagateInterruptState) {
918         getPoolProperties().setPropagateInterruptState(propagateInterruptState);
919     }
920
921     /**
922      * {@inheritDoc}
923      */
924     @Override
925     public boolean isIgnoreExceptionOnPreLoad() {
926         return getPoolProperties().isIgnoreExceptionOnPreLoad();
927     }
928
929     /**
930      * {@inheritDoc}
931      */
932     @Override
933     public void setIgnoreExceptionOnPreLoad(boolean ignoreExceptionOnPreLoad) {
934         // noop - this pool is already running
935         throw new UnsupportedOperationException();
936     }
937
938     /**
939      * {@inheritDoc}
940      */
941     @Override
942     public void purge() {
943         pool.purge();
944
945     }
946
947     /**
948      * {@inheritDoc}
949      */
950     @Override
951     public void purgeOnReturn() {
952         pool.purgeOnReturn();
953
954     }
955
956
957
958
959
960 }