private < T > Future < T > submitTaskToQueue ( SQLQueueCallable < T > callable ) { if ( acceptTasks . get ( ) ) { return queue . submit ( callable ) ; } else { throw new RejectedExecutionException ( "Database is closed" ) ; } }
Adds a task to the queue checking if the queue is still open to accepting tasks