How do I create a ScheduledThreadPoolExecutor with a single thread without using the Executors.newSingleThreadScheduledExecutor ?
The reason I want to do so is that the later call returns an instance of DelegatedScheduledExecutorService and not an instance of ThreadPoolExecutor , so my attempts to be able to use methods such as getQueue() etc fails. If I can create a ThreadPoolExecutor directly that would help.
And the reason I want to getQueue() is that there is no other way to know the size of the tasks currently queued up in the executor.
Using the constructor of ScheduledThreadPoolExecutor.