Source:
private void initManagementContext() { if (managementContext == null) { if (brooklynProperties == null) { BrooklynProperties.Factory.Builder builder = BrooklynProperties.Factory.builderDefault(); if (globalBrooklynPropertiesFile != null) { if (fileExists(globalBrooklynPropertiesFile)) { LOG.debug("Using global properties file "+globalBrooklynPropertiesFile); checkFileReadable(globalBrooklynPropertiesFile); checkFilePermissionsX00(globalBrooklynPropertiesFile); } else { LOG.debug("Global properties file "+globalBrooklynPropertiesFile+" does not exist, will ignore"); } builder.globalPropertiesFile(globalBrooklynPropertiesFile); } else { LOG.debug("Global properties file disabled"); builder.globalPropertiesFile(null); } if (localBrooklynPropertiesFile != null) { checkFileReadable(localBrooklynPropertiesFile); checkFilePermissionsX00(localBrooklynPropertiesFile); builder.localPropertiesFile(localBrooklynPropertiesFile); } managementContext = new LocalManagementContext(builder, brooklynAdditionalProperties); } else { if (globalBrooklynPropertiesFile != null) LOG.warn("Ignoring globalBrooklynPropertiesFile "+globalBrooklynPropertiesFile+" because explicit brooklynProperties supplied"); if (localBrooklynPropertiesFile != null) LOG.warn("Ignoring localBrooklynPropertiesFile "+localBrooklynPropertiesFile+" because explicit brooklynProperties supplied"); managementContext = new LocalManagementContext(brooklynProperties, brooklynAdditionalProperties); } brooklynProperties = ((ManagementContextInternal)managementContext).getBrooklynProperties(); BrooklynShutdownHooks.invokeTerminateOnShutdown(managementContext); } else if (brooklynProperties == null) { brooklynProperties = ((ManagementContextInternal)managementContext).getBrooklynProperties(); brooklynProperties.addFromMap(brooklynAdditionalProperties); } ((ManagementContextInternal)managementContext).setCatalogInitialization(catalogInitialization); if (customizeManagement!=null) { customizeManagement.apply(managementContext); } }

Target:
private void initManagementContext() { if (managementContext == null) { if (brooklynProperties == null) { BrooklynProperties.Factory.Builder builder = BrooklynProperties.Factory.builderDefault(); if (globalBrooklynPropertiesFile != null) { if (fileExists(globalBrooklynPropertiesFile)) { LOG.debug("Using global properties file "+globalBrooklynPropertiesFile); checkFileReadable(globalBrooklynPropertiesFile); checkFilePermissionsX00(globalBrooklynPropertiesFile); } else { LOG.debug("Global properties file "+globalBrooklynPropertiesFile+" does not exist, will ignore"); } builder.globalPropertiesFile(globalBrooklynPropertiesFile); } else { LOG.debug("Global properties file disabled"); builder.globalPropertiesFile(null); } if (localBrooklynPropertiesFile != null) { checkFileReadable(localBrooklynPropertiesFile); checkFilePermissionsX00(localBrooklynPropertiesFile); builder.localPropertiesFile(localBrooklynPropertiesFile); } managementContext = new LocalManagementContext(builder, brooklynAdditionalProperties); } else { if (globalBrooklynPropertiesFile != null) LOG.warn("Ignoring globalBrooklynPropertiesFile "+globalBrooklynPropertiesFile+" because explicit brooklynProperties supplied"); if (localBrooklynPropertiesFile != null) LOG.warn("Ignoring localBrooklynPropertiesFile "+localBrooklynPropertiesFile+" because explicit brooklynProperties supplied"); managementContext = new LocalManagementContext(brooklynProperties, brooklynAdditionalProperties); } brooklynProperties = ((ManagementContextInternal)managementContext).getBrooklynProperties(); BrooklynShutdownHooks.invokeTerminateOnShutdown(managementContext); } else if (brooklynProperties == null) { brooklynProperties = ((ManagementContextInternal)managementContext).getBrooklynProperties(); brooklynProperties.addFromMap(brooklynAdditionalProperties); } if (catalogInitialization!=null) { ((ManagementContextInternal)managementContext).setCatalogInitialization(catalogInitialization); } if (customizeManagement!=null) { customizeManagement.apply(managementContext); } }