@ Override public CONFIG applyConfigUpdate ( final CONFIG config ) throws CouldNotPerformException , InterruptedException { try { boolean scopeChanged ; try ( final CloseableWriteLockWrapper ignored = getManageWriteLock ( this ) ) { this . config = config ; if ( supportsDataField ( TYPE_FIELD_ID ) && hasConfigField ( TYPE_FIELD_ID ) ) { setDataField ( TYPE_FIELD_ID , getConfigField ( TYPE_FIELD_ID ) ) ; } if ( supportsDataField ( TYPE_FIELD_LABEL ) && hasConfigField ( TYPE_FIELD_LABEL ) ) { setDataField ( TYPE_FIELD_LABEL , getConfigField ( TYPE_FIELD_LABEL ) ) ; } scopeChanged = ! currentScope . equals ( detectScope ( config ) ) ; currentScope = detectScope ( ) ; } // detect scope change if instance is already active and reinit if needed. // this needs to be done without holding the config lock to avoid a deadlock with the server manageable lock. try { if ( isActive ( ) && scopeChanged ) { super . init ( currentScope ) ; } } catch ( CouldNotPerformException ex ) { throw new CouldNotPerformException ( "Could not verify scope changes!" , ex ) ; } return this . config ; } catch ( CouldNotPerformException ex ) { throw new CouldNotPerformException ( "Could not apply config update!" , ex ) ; } }
Apply an update to the configuration of this controller .