@Override public void activate() throws InterruptedException, CouldNotPerformException { synchronized (netDeviceDetectorMapLock) { for (NetDeviceDetector detector : netDeviceDetectorMap.values()) { try { detector.activate(); } catch (CouldNotPerformException ex) { ExceptionPrinter.printHistory("Could not activate " + detector + "!", ex, logger); } } } super.activate(); }
@Override public void deactivate() throws InterruptedException, CouldNotPerformException { stop(); super.deactivate(); }
@Override public void init(final UnitConfig config) throws InitializationException, InterruptedException { super.init(config); }
@Override public UnitConfig applyConfigUpdate(UnitConfig config) throws CouldNotPerformException, InterruptedException { UnitConfig unitConfig = super.applyConfigUpdate(config); serviceRemoteManager.applyConfigUpdate(unitConfig.getUnitGroupConfig().getMemberIdList()); return unitConfig; }
@Override public void registerMethods(RSBLocalServer server) throws CouldNotPerformException { // TODO Tamino: Make sure the unit template of connections already contains all services which are defined in the connection interface. // afterwarts remove this method because all services should be registered by the abstract unit class. Please make sure the mock registry registeres these services as well. RPCHelper.registerInterface(Connection.class, this, server); super.registerMethods(server); }
@Override public Future<ActionFuture> applyAction(final ActionDescription actionDescription) throws CouldNotPerformException, InterruptedException { switch (actionDescription.getServiceStateDescription().getServiceType()) { case STANDBY_STATE_SERVICE: return super.applyAction(actionDescription); default: return serviceRemoteManager.applyAction(actionDescription); } }
@Override public synchronized UnitConfig applyConfigUpdate(final UnitConfig config) throws CouldNotPerformException, InterruptedException { UnitConfig unitConfig = super.applyConfigUpdate(config); serviceRemoteManager.applyConfigUpdate(unitConfig.getLocationConfig().getUnitIdList()); // if already active than update the current location state. if (isActive()) { updateUnitData(); } return unitConfig; }
@Override public void deactivate() throws InterruptedException, CouldNotPerformException { super.deactivate(); serviceRemoteManager.deactivate(); }
return super.applyConfigUpdate(config);
@Override public void activate() throws InterruptedException, CouldNotPerformException { serviceRemoteManager.activate(); super.activate(); updateCurrentState(); }
@Override public void init(final UnitConfig config) throws InitializationException, InterruptedException { LOGGER.debug("Init connection [" + config.getLabel() + "]"); try { Registries.getUnitRegistry().waitForData(); } catch (CouldNotPerformException ex) { throw new InitializationException(this, ex); } super.init(config); }
@Override public void deactivate() throws InterruptedException, CouldNotPerformException { synchronized (netDeviceDetectorMapLock) { for (NetDeviceDetector detector : netDeviceDetectorMap.values()) { try { detector.deactivate(); } catch (CouldNotPerformException ex) { ExceptionPrinter.printHistory("Could not deactivate " + detector + "!", ex, logger); } } } super.deactivate(); }
@Override public synchronized UnitConfig applyConfigUpdate(final UnitConfig config) throws CouldNotPerformException, InterruptedException { UnitConfig unitConnectionConfig = super.applyConfigUpdate(config); serviceRemoteManager.applyConfigUpdate(unitConnectionConfig.getConnectionConfig().getUnitIdList());
@Override public void activate() throws InterruptedException, CouldNotPerformException { super.activate(); MultiException.ExceptionStack exceptionStack = null; synchronized (unitMapLock) { for (AbstractUnitController unit : unitMap.values()) { try { unit.activate(); } catch (CouldNotPerformException ex) { exceptionStack = MultiException.push(this, ex, exceptionStack); } } } MultiException.checkAndThrow("Could not activate all hosted units of " + this, exceptionStack); }
@Override public void init(final UnitConfig config) throws InitializationException, InterruptedException { LOGGER.debug("Init location [" + config.getLabel() + "]"); try { Registries.getUnitRegistry().waitForData(); } catch (CouldNotPerformException ex) { throw new InitializationException(this, ex); } super.init(config); // do not notify because not activated yet try (ClosableDataBuilder<LocationData.Builder> dataBuilder = getDataBuilder(this, false)) { dataBuilder.getInternalBuilder().setStandbyState(StandbyState.newBuilder().setValue(StandbyState.State.RUNNING).build()); } catch (Exception ex) { ExceptionPrinter.printHistory(new CouldNotPerformException("Could not apply initial standby service states!", ex), LOGGER, LogLevel.WARN); } presenceDetector.init(this); standbyController.init(this); }
@Override public void deactivate() throws CouldNotPerformException, InterruptedException { logger.debug("Deactivate UnitGroupController[" + getConfig().getLabel() + "]"); serviceRemoteManager.deactivate(); super.deactivate(); }
@Override public UnitConfig applyConfigUpdate(UnitConfig config) throws CouldNotPerformException, InterruptedException { UnitConfig unitConfig = super.applyConfigUpdate(config); Registries.getUnitRegistry().waitForData();
@Override public void activate() throws InterruptedException, CouldNotPerformException { logger.debug("Activate UnitGroupController[" + getConfig().getLabel() + "]"); super.activate(); serviceRemoteManager.activate(); updateUnitData(); }
@Override public void deactivate() throws InterruptedException, CouldNotPerformException { LOGGER.debug("Deactivate location [" + getLabel() + "]!"); super.deactivate(); serviceRemoteManager.deactivate(); presenceDetector.deactivate(); }
@Override public void activate() throws InterruptedException, CouldNotPerformException { if (isActive()) { LOGGER.debug("Skipp location controller activations because is already active..."); return; } LOGGER.debug("Activate location [" + getLabel() + "]!"); super.activate(); serviceRemoteManager.activate(); presenceDetector.activate(); updateUnitData(); }