/** * @deprecated since 0.7; use {@link #getLocalConfigBag()} * @since 0.6 */ @Deprecated public ConfigBag getRawLocalConfigBag() { return config().getLocalBag(); }
location.config().set((ConfigKey)entry.getKey(), entry.getValue());
@Override public <T> T getConfig(HasConfigKey<T> key) { return config().get(key); }
@Override public <T> T getConfig(ConfigKey<T> key) { return config().get(key); }
@Override @Deprecated public <T> T setConfig(ConfigKey<T> key, T value) { return config().set(key, value); }
@Override @Deprecated public ConfigBag getAllConfigBag() { // TODO see comments in EntityConfigMap and on interface methods. // here ConfigBag is used exclusively so // we have no information about what to include/exclude inheritance wise. // however few things use getAllConfigBag() return config().getBag(); }
@Override public ConfigBag getLocalConfigBag() { return config().getLocalBag(); }
@Override @Deprecated public Map<String,Object> getAllConfig(boolean includeInherited) { // TODO Have no information about what to include/exclude inheritance wise. // however few things use getAllConfigBag() ConfigBag bag = (includeInherited ? config().getBag() : config().getLocalBag()); return bag.getAllConfig(); }
@Override @Deprecated public boolean hasConfig(ConfigKey<?> key, boolean includeInherited) { return config().getInternalConfigMap().getConfigInheritedRaw(key).getWithoutError().asMaybe().isPresent(); }
@SuppressWarnings({ "rawtypes", "unchecked" }) private synchronized void unmanageNonRecursiveClearItsFields(Location loc, ManagementTransitionMode mode) { if (mode.isDestroying()) { ((AbstractLocation)loc).setParent(null, true); Location parent = ((AbstractLocation)loc).getParent(); if (parent instanceof ProvisioningLocation<?>) { try { ((ProvisioningLocation)parent).release(loc); } catch (Exception e) { Exceptions.propagateIfFatal(e); log.debug("Error releasing "+loc+" in its parent "+parent+": "+e); } } } else { // if not destroying, don't change the parent's children list ((AbstractLocation)loc).setParent(null, false); } // clear config to help with GC; everyone says you're not supposed to, but this really seems to help, // else config bag is littered with refs to entities etc and some JVMs seem to keep them around much longer ((AbstractLocation)loc).config().removeAllLocalConfig(); }