private void configureListeners(String workerUUID, Collection<IterationListener> oldListeners, Collection<IterationListener> replicatedListeners) { for (IterationListener listener : oldListeners) { IterationListener l = cloneListener(listener); if (l instanceof RoutingIterationListener) { RoutingIterationListener rl = (RoutingIterationListener) l; //We're assuming session ID is set by the original RoutingIterationListener constructor, which means // it will be synced across all cloned instances rl.setSessionID(((RoutingIterationListener) listener).getSessionID()); rl.setWorkerID(workerUUID); StatsStorageRouter currentRouter = ((RoutingIterationListener) listener).getStorageRouter(); if (currentRouter != null) { //User has set router on the listener/model, instead of via the // setListeners(StatsStorageRouter, ...) method rl.setStorageRouter(currentRouter); } else { rl.setStorageRouter(ParallelWrapper.this.storageRouter); } } replicatedListeners.add(l); } } }
private void configureListeners(String workerUUID, Collection<IterationListener> oldListeners, Collection<IterationListener> replicatedListeners) { for (IterationListener listener : oldListeners) { IterationListener l = cloneListener(listener); if (l instanceof RoutingIterationListener) { RoutingIterationListener rl = (RoutingIterationListener) l; //We're assuming session ID is set by the original RoutingIterationListener constructor, which means // it will be synced across all cloned instances rl.setSessionID(((RoutingIterationListener) listener).getSessionID()); rl.setWorkerID(workerUUID); StatsStorageRouter currentRouter = ((RoutingIterationListener) listener).getStorageRouter(); if (currentRouter != null) { //User has set router on the listener/model, instead of via the // setListeners(StatsStorageRouter, ...) method rl.setStorageRouter(currentRouter); } else { rl.setStorageRouter(ParallelWrapper.this.storageRouter); } } replicatedListeners.add(l); } } }