}//endif
/* Cancel/remove pending tasks from the task manager and terminate */
if(discoveryTaskMgr != null) {
ArrayList pendingTasks = discoveryTaskMgr.getPending();
for(int i=0;i<pendingTasks.size();i++) {
RetryTask pendingTask = (RetryTask)pendingTasks.get(i);
pendingTask.cancel();//cancel wakeup ticket
discoveryTaskMgr.remove(pendingTask);//remove from task mgr
}//end loop
discoveryTaskMgr.terminate();//interrupt all active tasks
discoveryTaskMgr = null;
discoveryWakeupMgr = null;