@ Override public BlockingQueue < Work > getWorkQueue ( ) { BlockingQueue < Work > queue = new LinkedBlockingQueue < Work > ( ) ; BlockingQueue < Runnable > workQueue = executor . getQueue ( ) ; for ( Runnable r : workQueue ) { if ( r instanceof EventWorker ) { queue . add ( ( ( EventWorker ) r ) . work ) ; } } return queue ; }
Returns a snapshot of the current state of the queue in the executor and not the Queue itself .