private void setAvailabilityState(final AvailabilityState.State controllerAvailability) throws InterruptedException {
        synchronized (controllerAvailabilityMonitor) {

            // filter unchanged events
            if (this.availabilityState.equals(controllerAvailability)) {
                return;
            }

            // update state and notify
            this.availabilityState = controllerAvailability;
            logger.debug(this + " is now " + controllerAvailability.name());

            try {
                // notify remotes about controller shutdown
                if (availabilityState.equals(DEACTIVATING)) {
                    try {
                        logger.debug("Notify data change of " + this);
                        validateInitialization();
                        if (!informer.isActive()) {
                            logger.debug("Skip update notification because connection not established.");
                            return;
                        }
                        try {
                            informer.publish(new Event(informer.getScope(), Void.class, null));
                        } catch (CouldNotPerformException ex) {
                            throw new CouldNotPerformException("Could not notify change of " + this + "!", ex);
                        }
                    } catch (final NotInitializedException ex) {
                        logger.debug("Skip update notification because instance is not initialized.");
                    } catch (CouldNotPerformException ex) {
                        ExceptionPrinter.printHistory(new CouldNotPerformException("Could not update communication service state in internal data object!", ex), logger);
                    }
                }
            } finally {
                // wakeup listener.
                this.controllerAvailabilityMonitor.notifyAll();
            }
        }
    }
private void setAvailabilityState ( final AvailabilityState . State controllerAvailability ) throws InterruptedException { synchronized ( controllerAvailabilityMonitor ) { if ( this . availabilityState . equals ( controllerAvailability ) ) { return ; } this . availabilityState = controllerAvailability ; logger . debug ( this + " is now " + controllerAvailability . name ( ) ) ; try { if ( availabilityState . equals ( DEACTIVATING ) ) { try { logger . debug ( "Notify data change of " + this ) ; validateInitialization ( ) ; if ( ! informer . isActive ( ) ) { logger . debug ( "Skip update notification because connection not established." ) ; return ; } try { informer . publish ( new Event ( informer . getScope ( ) , Void . class , null ) ) ; } catch ( CouldNotPerformException ex ) { throw new CouldNotPerformException ( "Could not notify change of " + this + "!" , ex ) ; } } catch ( final NotInitializedException ex ) { logger . debug ( "Skip update notification because instance is not initialized." ) ; } catch ( CouldNotPerformException ex ) { ExceptionPrinter . printHistory ( new CouldNotPerformException ( "Could not update communication service state in internal data object!" , ex ) , logger ) ; } } } finally { this . controllerAvailabilityMonitor . notifyAll ( ) ; } } }
@param controllerAvailability

@throws InterruptedException