public void initializeTasks() { getLogger().info("Initializing Scheduler..."); // this call delegates to task config manager that loads up the persisted tasks (if any) // and performs a series of callbacks to this to make them "alive" taskConfig.initializeTasks(this); // wind up the "idGen" source, to the max ID we got loaded up from config (the generated IDs are persisted) int maxId = 0; for (Map.Entry<String, List<ScheduledTask<?>>> entry : getAllTasks().entrySet()) { for (ScheduledTask<?> task : entry.getValue()) { try { maxId = Math.max(maxId, Integer.parseInt(task.getId())); } catch (NumberFormatException e) { // be forgiving about non number IDs // hint1: sadly, some Nexus ITs does have them // hint2: they will not clash with numbers anyway } } } idGen.set(maxId); }
public void initializeTasks() { getLogger().info( "Initializing Scheduler..." ); // this call delegates to task config manager that loads up the persisted tasks (if any) // and performs a series of callbacks to this to make them "alive" taskConfig.initializeTasks( this ); // wind up the "idGen" source, to the max ID we got loaded up from config (the generated IDs are persisted) int maxId = 0; for ( Map.Entry<String, List<ScheduledTask<?>>> entry : getAllTasks().entrySet() ) { for ( ScheduledTask<?> task : entry.getValue() ) { try { maxId = Math.max( maxId, Integer.parseInt( task.getId() ) ); } catch ( NumberFormatException e ) { // be forgiving about non number IDs // hint1: sadly, some Nexus ITs does have them // hint2: they will not clash with numbers anyway } } } idGen.set( maxId ); }