public static void waitForData(long timeout, TimeUnit timeUnit) throws CouldNotPerformException, InterruptedException { getRegistry().waitForData(timeout, timeUnit); }
public static void waitForData() throws InterruptedException, CouldNotPerformException { getRegistry().waitForData(); }
/** * Returns an initialized and activated remote registry. * * @param waitForData defines if this call should block until the registry data is available. * @return the remote registry instance. * @throws NotAvailableException * @throws InterruptedException is thrown if thread is externally interrupted. */ public static LocationRegistryRemote getLocationRegistry(final boolean waitForData) throws CouldNotPerformException, InterruptedException { if (waitForData) { CachedLocationRegistryRemote.getRegistry().waitForData(); } return CachedLocationRegistryRemote.getRegistry(); }
private void init() throws InitializationException, InterruptedException, CouldNotPerformException { logger.info("init"); Registries.getUnitRegistry().waitForData(); Registries.getDeviceRegistry().waitForData(); Registries.getLocationRegistry().waitForData(); }
@Override public void init() throws InitializationException, InterruptedException { super.init(LOCATION_MANAGER_ITEM_FILTER, new LocationBindingOpenHABRemote(hardwareSimulationMode, locationRegistry, connectionRegistry, unitGroupRegistry)); try { Registries.getLocationRegistry().waitForData(); locationRemoteFactory.init(openHABRemote); connectionRemoteFactory.init(openHABRemote); unitGroupRemoteFactory.init(openHABRemote); } catch (CouldNotPerformException ex) { throw new InitializationException(this, ex); } }
public PartyLightTileFollowerApp() throws InstantiationException, InterruptedException { super(PartyLightTileFollowerApp.class); try { Registries.getLocationRegistry().waitForData(); Registries.getUnitRegistry().waitForData(); this.locationRemoteMap = new HashMap<>(); // init tile remotes for (final UnitConfig locationUnitConfig : Registries.getLocationRegistry().getLocationConfigs()) { if (!locationUnitConfig.getLocationConfig().getType().equals(LocationConfigType.LocationConfig.LocationType.TILE)) { continue; } locationRemoteMap.put(locationUnitConfig.getId(), Units.getUnit(locationUnitConfig, false, Units.LOCATION)); } } catch (CouldNotPerformException ex) { throw new InstantiationException(this, ex); } }
public void init() throws InitializationException, InterruptedException, CouldNotPerformException { statusPanel = StatusPanel.getInstance(); statusPanel.setStatus("Wait for unit registry...", StatusPanel.StatusType.INFO, true); Registries.getUnitRegistry().waitForData(); statusPanel.setStatus("Wait for location registry...", StatusPanel.StatusType.INFO, true); Registries.getLocationRegistry().waitForData(); statusPanel.setStatus("Connection established.", StatusPanel.StatusType.INFO, 3); // register change observer Registries.getUnitRegistry().addDataObserver((Observable<UnitRegistryDataType.UnitRegistryData> source, UnitRegistryDataType.UnitRegistryData data) -> { SwingUtilities.invokeLater(() -> { updateDynamicComponents(); }); }); Registries.getLocationRegistry().addDataObserver((Observable<LocationRegistryData> source, LocationRegistryData data) -> { SwingUtilities.invokeLater(() -> { updateDynamicComponents(); }); }); init = true; setEnable(true); updateDynamicComponents(); }