/** * Reconfigures this instance with the specified value if authorized * by the {@link SecurityContext}. This method returns the actual new * value which may be different from the requested new value * (see {@link #reconfigured(Object, Object)}). * * @param newValue the requested new value. * @return the actual new value. * @throws SecurityException if the permission to reconfigure this * configurable is not granted. * @throws UnsupportedOperationException if this configurable does not * support dynamic reconfiguration. */ public T reconfigure(T newValue) { SecurityContext.check(reconfigurePermission); synchronized (this) { T oldValue = this.value; this.value = reconfigured(oldValue, newValue); Object[] listeners = OSGiServices.getConfigurableListeners(); for (Object listener : listeners) { ((Listener) listener).configurableReconfigured(this, oldValue, this.value); } return this.value; } }