コード例 #1
0
ファイル: ConnectionPool.java プロジェクト: sqtds/tomcat7
 @Override
 public void setTimeBetweenEvictionRunsMillis(int timeBetweenEvictionRunsMillis) {
   boolean wasEnabled = getPoolProperties().isPoolSweeperEnabled();
   getPoolProperties().setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
   boolean shouldBeEnabled = getPoolProperties().isPoolSweeperEnabled();
   // make sure pool cleaner starts/stops when it should
   if (!wasEnabled && shouldBeEnabled) {
     pool.initializePoolCleaner(getPoolProperties());
   } else if (wasEnabled) {
     pool.terminatePoolCleaner();
     if (shouldBeEnabled) {
       pool.initializePoolCleaner(getPoolProperties());
     }
   }
 }
コード例 #2
0
ファイル: ConnectionPool.java プロジェクト: sqtds/tomcat7
 @Override
 public void setRemoveAbandonedTimeout(int removeAbandonedTimeout) {
   boolean wasEnabled = getPoolProperties().isPoolSweeperEnabled();
   getPoolProperties().setRemoveAbandonedTimeout(removeAbandonedTimeout);
   boolean shouldBeEnabled = getPoolProperties().isPoolSweeperEnabled();
   // make sure pool cleaner starts/stops when it should
   if (!wasEnabled && shouldBeEnabled) pool.initializePoolCleaner(getPoolProperties());
   else if (wasEnabled && !shouldBeEnabled) pool.terminatePoolCleaner();
 }
コード例 #3
0
ファイル: ConnectionPool.java プロジェクト: sqtds/tomcat7
 @Override
 public void setTestWhileIdle(boolean testWhileIdle) {
   boolean wasEnabled = getPoolProperties().isPoolSweeperEnabled();
   getPoolProperties().setTestWhileIdle(testWhileIdle);
   boolean shouldBeEnabled = getPoolProperties().isPoolSweeperEnabled();
   // make sure pool cleaner starts/stops when it should
   if (!wasEnabled && shouldBeEnabled) pool.initializePoolCleaner(getPoolProperties());
   else if (wasEnabled && !shouldBeEnabled) pool.terminatePoolCleaner();
 }
コード例 #4
0
ファイル: ConnectionPool.java プロジェクト: sqtds/tomcat7
 @Override
 public void setMinEvictableIdleTimeMillis(int minEvictableIdleTimeMillis) {
   boolean wasEnabled = getPoolProperties().isPoolSweeperEnabled();
   getPoolProperties().setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
   boolean shouldBeEnabled = getPoolProperties().isPoolSweeperEnabled();
   // make sure pool cleaner starts/stops when it should
   if (!wasEnabled && shouldBeEnabled) pool.initializePoolCleaner(getPoolProperties());
   else if (wasEnabled && !shouldBeEnabled) pool.terminatePoolCleaner();
 }