public RebindIteration(RebindManagerImpl rebindManager, ManagementNodeState mode, ClassLoader classLoader, RebindExceptionHandler exceptionHandler, Semaphore rebindActive, AtomicInteger readOnlyRebindCount, PersistenceActivityMetrics rebindMetrics, BrooklynMementoPersister persistenceStoreAccess ) { // NB: there is no particularly deep meaning in what is passed in vs what is looked up from the RebindManager which calls us // (this is simply a refactoring of previous code to a new class) this.rebindManager = rebindManager; this.mode = mode; this.classLoader = checkNotNull(classLoader, "classLoader"); this.exceptionHandler = checkNotNull(exceptionHandler, "exceptionHandler"); this.rebindActive = rebindActive; this.readOnlyRebindCount = readOnlyRebindCount; this.rebindMetrics = rebindMetrics; this.persistenceStoreAccess = persistenceStoreAccess; managementContext = rebindManager.getManagementContext(); rebindContext = new RebindContextImpl(managementContext, exceptionHandler, classLoader); reflections = new Reflections(classLoader).applyClassRenames(DeserializingClassRenamesProvider.INSTANCE.loadDeserializingMapping()); instantiator = new BrooklynObjectInstantiator(classLoader, rebindContext, reflections); if (mode==ManagementNodeState.HOT_STANDBY || mode==ManagementNodeState.HOT_BACKUP) { rebindContext.setAllReadOnly(); } else { Preconditions.checkState(mode==ManagementNodeState.MASTER, "Must be either master or read only to rebind (mode "+mode+")"); } }