Update of /cvsroot/squirrel-sql/sql12/fw/src/net/sourceforge/squirrel_sql/fw/util
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv1839/fw/src/net/sourceforge/squirrel_sql/fw/util
Modified Files:
TaskThreadPool.java
Log Message:
Aliases now have the ability to setup keep-alive SQL statement and sleep time (in seconds) to prevent a connection from being disconnected while appearing to be idle.
Index: TaskThreadPool.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/fw/src/net/sourceforge/squirrel_sql/fw/util/TaskThreadPool.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TaskThreadPool.java 9 Sep 2007 01:32:29 -0000 1.6
--- TaskThreadPool.java 19 Dec 2009 21:33:51 -0000 1.7
***************
*** 52,62 ****
private JFrame _parentForMessages = null;
! /**
* Add a task to be executed by the next available thread
* in this thread pool. If there is no free thread available
* but the maximum number of threads hasn't been reached then
* create a new thread.
! */
! public synchronized void addTask(Runnable task)
throws IllegalArgumentException
{
--- 52,89 ----
private JFrame _parentForMessages = null;
! /**
* Add a task to be executed by the next available thread
* in this thread pool. If there is no free thread available
* but the maximum number of threads hasn't been reached then
* create a new thread.
! *
! * @param task the Runnable to give to the thread
! * @param taskName the name of the task (used to set the Thread name)
! * @throws IllegalArgumentException
! */
! public synchronized void addTask(Runnable task, String taskName)
! throws IllegalArgumentException
! {
! _addTask(task, taskName);
! }
!
! /**
! * Add a task to be executed by the next available thread
! * in this thread pool. If there is no free thread available
! * but the maximum number of threads hasn't been reached then
! * create a new thread.
! *
! * @param task
! * @throws IllegalArgumentException
! * @Deprecated Please use the form that accepts a task name instead.
! */
! public synchronized void addTask(Runnable task)
! throws IllegalArgumentException
! {
! _addTask(task, null);
! }
!
!
! private synchronized void _addTask(Runnable task, String taskName)
throws IllegalArgumentException
{
***************
*** 70,73 ****
--- 97,103 ----
{
Thread th = new Thread(new TaskExecuter(_callback));
+ if (taskName != null) {
+ th.setName(taskName);
+ }
th.setPriority(Thread.MIN_PRIORITY); //??
th.setDaemon(true);
|