/** * Remove data access controller * * <p>This method will close data access controller, it will also stop all ongoing tasks related * to this data access controller. * * @param controller data access controller * @param cancelTasks whether to cancel the tasks associated with this controller */ public final synchronized void removeDataAccessController( DataAccessController controller, boolean cancelTasks) { if (cancelTasks) { // cancel all the tasks related to this data access controller TaskManager taskMgr = this.getTaskManager(); taskMgr.cancelTasksByOwner(controller); } // remove gui component associated with this data access controller removeDataContentPane(controller); // remove pride action removePrideAction(controller); // remove summary report summaryReportTracker.remove(controller); // remove data access controller dataAccessMonitor.removeDataAccessController(controller); }
/** * Replace one data access controller with another. * * @param original original data access controller * @param replacement replacement data access controller * @param cancelTasks whether to cancel the tasks associated with this controller */ public final synchronized void replaceDataAccessController( DataAccessController original, DataAccessController replacement, boolean cancelTasks) { if (cancelTasks) { // cancel all the tasks related to this data access controller TaskManager taskMgr = this.getTaskManager(); taskMgr.cancelTasksByOwner(original); } // remove gui component removeDataContentPane(original); // remove pride action removePrideAction(original); // remove summary report for the original data access controller summaryReportTracker.remove(original); // add new summary report for the new data access controller getSummaryReportModel(replacement); // replace dataAccessMonitor.replaceDataAccessController(original, replacement); }