Source:
<code>void startClusterManagementService() throws IOException { startConfigurationPersistenceService(); <START> InternalCache myCache = this.internalCache; <END> InternalLocator currentLocator = InternalLocator.locator; if (myCache == null || currentLocator == null) { return; } clusterManagementService = new LocatorClusterManagementService(currentLocator.internalCache, currentLocator.configurationPersistenceService); AgentUtil agentUtil = new AgentUtil(GemFireVersion.getGemFireVersion()); URI gemfireManagementWar = agentUtil.findWarLocation("geode-web-management"); if (gemfireManagementWar == null) { logger.info( "Unable to find GemFire V2 Management REST API WAR file; the Management REST Interface for Geode will not be accessible."); return; } Map<String, Object> serviceAttributes = new HashMap<>(); serviceAttributes.put(HttpService.SECURITY_SERVICE_SERVLET_CONTEXT_PARAM, myCache.getSecurityService()); serviceAttributes.put(HttpService.CLUSTER_MANAGEMENT_SERVICE_CONTEXT_PARAM, clusterManagementService); String[] authEnabledComponents = distributionConfig.getSecurityAuthTokenEnabledComponents(); boolean managementAuthTokenEnabled = Arrays.stream(authEnabledComponents) .anyMatch(AuthTokenEnabledComponents::hasManagement); serviceAttributes.put(HttpService.AUTH_TOKEN_ENABLED_PARAM, managementAuthTokenEnabled); if (distributionConfig.getEnableManagementRestService()) { myCache.getOptionalService(HttpService.class).ifPresent(x -> { try { logger.info("Geode Property {}=true Geode Management Rest Service is enabled.", ConfigurationProperties.ENABLE_MANAGEMENT_REST_SERVICE); x.addWebApplication("/management", Paths.get(gemfireManagementWar), serviceAttributes); } catch (Throwable e) { logger.warn("Unable to start management service: {}", e.getMessage()); } }); } else { logger.info("Geode Property {}=false Geode Management Rest Service is disabled.", ConfigurationProperties.ENABLE_MANAGEMENT_REST_SERVICE); } }</code><technical_language>want mind-read here, rationale for a local copy</technical_language>

Target:
void startClusterManagementService() throws IOException { startConfigurationPersistenceService(); InternalCache myCache = this.internalCache; if (myCache == null) { return; } clusterManagementService = new LocatorClusterManagementService(myCache, configurationPersistenceService); AgentUtil agentUtil = new AgentUtil(GemFireVersion.getGemFireVersion()); URI gemfireManagementWar = agentUtil.findWarLocation("geode-web-management"); if (gemfireManagementWar == null) { logger.info( "Unable to find GemFire V2 Management REST API WAR file; the Management REST Interface for Geode will not be accessible."); return; } Map<String, Object> serviceAttributes = new HashMap<>(); serviceAttributes.put(HttpService.SECURITY_SERVICE_SERVLET_CONTEXT_PARAM, myCache.getSecurityService()); serviceAttributes.put(HttpService.CLUSTER_MANAGEMENT_SERVICE_CONTEXT_PARAM, clusterManagementService); String[] authEnabledComponents = distributionConfig.getSecurityAuthTokenEnabledComponents(); boolean managementAuthTokenEnabled = Arrays.stream(authEnabledComponents) .anyMatch(AuthTokenEnabledComponents::hasManagement); serviceAttributes.put(HttpService.AUTH_TOKEN_ENABLED_PARAM, managementAuthTokenEnabled); if (distributionConfig.getEnableManagementRestService()) { myCache.getOptionalService(HttpService.class).ifPresent(x -> { try { logger.info("Geode Property {}=true Geode Management Rest Service is enabled.", ConfigurationProperties.ENABLE_MANAGEMENT_REST_SERVICE); x.addWebApplication("/management", Paths.get(gemfireManagementWar), serviceAttributes); } catch (Throwable e) { logger.warn("Unable to start management service: {}", e.getMessage()); } }); } else { logger.info("Geode Property {}=false Geode Management Rest Service is disabled.", ConfigurationProperties.ENABLE_MANAGEMENT_REST_SERVICE); } }