protected void assertNotYetManaged() { if (!inConstruction && (managementContext != null && managementContext.getLocationManager().isManaged(this))) { LOG.warn("Configuration being made to {} after deployment; may not be supported in future versions", this); } //throw new IllegalStateException("Cannot set configuration "+key+" on active location "+this) }
/** * Registers the given location (and all its children) with the management context. * @throws IllegalStateException if the parent location is not already managed * * @since 0.6.0 (added only for backwards compatibility, where locations are being created directly). * @deprecated in 0.6.0; use {@link LocationManager#createLocation(LocationSpec)} instead. */ public static void manage(Location loc, ManagementContext managementContext) { if (!managementContext.getLocationManager().isManaged(loc)) { log.warn("Deprecated use of unmanaged location ("+loc+"); will be managed automatically now but not supported in future versions"); // FIXME this occurs MOST OF THE TIME e.g. including BrooklynLauncher.location(locationString) // not sure what is the recommend way to convert from locationString to locationSpec, or the API we want to expose; // deprecating some of the LocationRegistry methods seems sensible? log.debug("Stack trace for location of: Deprecated use of unmanaged location; will be managed automatically now but not supported in future versions", new Exception("TRACE for: Deprecated use of unmanaged location")); managementContext.getLocationManager().manage(loc); } }