question: private void terminateTaskMgr ( ) { if ( discoveryWakeupMgr != null ) { discoveryWakeupMgr . stop ( ) ; discoveryWakeupMgr . cancelAll ( ) ; } if ( discoveryTaskMgr != null ) { List pendingTasks = discoveryTaskMgr . getPending ( ) ; for ( int i = 0 ; i < pendingTasks . size ( ) ; i ++ ) { RetryTask pendingTask = ( RetryTask ) pendingTasks . get ( i ) ; pendingTask . cancel ( ) ; discoveryTaskMgr . remove ( pendingTask ) ; } discoveryTaskMgr . terminate ( ) ; discoveryTaskMgr = null ; discoveryWakeupMgr = null ; } }
target:  Convenience method that removes all pending and active tasks from the TaskManager, and removes all pending tasks from the WakeupManager.