I am performing several tasks in ThreadPoolExecutor. I initialize it as follows:
private VideoExportExecutor executor; private BlockingQueue<Runnable> jobQueue; public void initialiseVideoProcessor() { jobQueue = new LinkedBlockingQueue<Runnable>(); executor = new VideoExportExecutor(1, 1, Long.MAX_VALUE, TimeUnit.SECONDS, jobQueue); }
I implemented my own implementation of runnable ( VideoExportThread ), which contains the getProgress() method to track the progress of submitted tasks. I present examples of this as follows:
executor.submit(new VideoExportThread(gcmPath));
I get the opportunity to request an executor / blockingQueue for current / waiting threads. I tried using jobQueue.toArray() and overriding the executing method beforeExecute(Thread t, Runnable r) , but in both cases the returned runnable is of type FutureTask, which does not contain a lot of data. Is there a way to use it to retrieve the original instance of VideoExportThread , to determine which ones are running, and to request its progress?
thanks
tishu source share