private static AbstractServiceRemote instantiatServiceRemote(final Class<? extends AbstractServiceRemote> serviceRemoteClass) throws org.openbase.jul.exception.InstantiationException { try { AbstractServiceRemote remote = serviceRemoteClass.newInstance(); return remote; } catch (InstantiationException | IllegalAccessException ex) { throw new org.openbase.jul.exception.InstantiationException(serviceRemoteClass, ex); } } }
public OpenHABItemConfigGenerator() throws InstantiationException { try { this.itemEntryList = new ArrayList<>(); this.groupEntryList = new ArrayList<>(); } catch (NullPointerException ex) { throw new InstantiationException(this, ex); } }
public PublishDeviceTransformationRegistryPlugin(final ProtoBufFileSynchronizedRegistry<String, UnitConfig, UnitConfig.Builder, UnitRegistryData.Builder> locationRegistry) throws org.openbase.jul.exception.InstantiationException { try { this.locationRegistry = locationRegistry; this.transformerFactory = TransformerFactory.getInstance(); } catch (Exception ex) { throw new org.openbase.jul.exception.InstantiationException(this, ex); } }
private AbstractServicePanel instantiatServicePanel(final ServiceConfig serviceConfig, Class<? extends AbstractServicePanel> servicePanelClass, AbstractUnitRemote unitRemote) throws org.openbase.jul.exception.InstantiationException, InterruptedException { try { AbstractServicePanel instance = servicePanelClass.newInstance(); instance.init(unitRemote, serviceConfig); return instance; } catch (NullPointerException | InstantiationException | CouldNotPerformException | IllegalAccessException ex) { throw new org.openbase.jul.exception.InstantiationException("Could not instantiate service panel out of ServicePanelClass[" + servicePanelClass.getSimpleName() + "]!", ex); } }
public PublishConnectionTransformationRegistryPlugin(final Registry<String, IdentifiableMessage<String, UnitConfig, UnitConfig.Builder>> locationRegistry) throws org.openbase.jul.exception.InstantiationException { try { this.locationRegistry = locationRegistry; this.transformerFactory = TransformerFactory.getInstance(); this.transformPublisher = transformerFactory.createTransformPublisher(getClass().getSimpleName()); } catch (Exception ex) { throw new org.openbase.jul.exception.InstantiationException(this, ex); } }
public DalUnitLabelConsistencyHandler(final ProtoBufFileSynchronizedRegistry<String, UnitConfig, UnitConfig.Builder, UnitRegistryData.Builder> deviceRegistry, final ProtoBufFileSynchronizedRegistry<String, UnitConfig, UnitConfig.Builder, UnitRegistryData.Builder> appRegistry) throws InstantiationException { try { this.deviceClassRegistry = CachedDeviceRegistryRemote.getRegistry().getDeviceClassRemoteRegistry(); this.deviceRegistry = deviceRegistry; this.appRegistry = appRegistry; this.oldUnitHostLabelMap = new HashMap<>(); } catch (final CouldNotPerformException | InterruptedException ex) { // remove InterruptedException in bco 2.0 release throw new InstantiationException(this, ex); } }
public DeviceLabelConsistencyHandler() throws InstantiationException { super(); try { this.deviceClassRegistry = CachedDeviceRegistryRemote.getRegistry().getDeviceClassRemoteRegistry(); } catch (final CouldNotPerformException | InterruptedException ex) { // remove InterruptedException in bco 2.0 release throw new InstantiationException(this, ex); } }
private Trigger initTrigger(final Trigger trigger, final TriggerConfig triggerConfig) throws InterruptedException, InstantiationException { try { trigger.init(triggerConfig); trigger.activate(); return trigger; } catch (CouldNotPerformException ex) { throw new InstantiationException("Could not initiate trigger instance!", ex); } }
public UnitAllocation(ExecutableResource<ActionFuture> taskExecutor) throws org.openbase.jul.exception.InstantiationException { try { this.taskExecutor = taskExecutor; try { taskExecutor.startup(); } catch (RSBException ex) { throw new CouldNotPerformException("Could not schedule allocation!", ex); } } catch (CouldNotPerformException ex) { throw new InstantiationException(this, ex); } }
@Override public AbstractServiceRemote newInstance(final ServiceType serviceType) throws org.openbase.jul.exception.InstantiationException { try { return instantiatServiceRemote(loadServiceRemoteClass(serviceType)); } catch (CouldNotPerformException ex) { throw new org.openbase.jul.exception.InstantiationException(AbstractServiceRemote.class, serviceType.name(), ex); } }
public static MockRegistry newMockRegistry() throws InstantiationException { synchronized (mockRegistrySync) { if (mockRegistry != null) { throw new InstantiationException(MockRegistryHolder.class, new InvalidStateException("There is still one MockRegistry instance running!")); } mockRegistry = new MockRegistry(); return mockRegistry; } }
public DeviceController newInstance(final UnitConfig deviceUnitConfig, final DeviceManager deviceManager) throws InstantiationException, InterruptedException { try { return newInstance(deviceUnitConfig, deviceManager.getServiceFactory()); } catch (CouldNotPerformException ex) { throw new InstantiationException(Device.class, deviceUnitConfig.getId(), ex); } }
public SceneRegistryController() throws InstantiationException, InterruptedException { super(JPSceneRegistryScope.class, SceneRegistryData.newBuilder()); try { unitRegistryRemote = CachedUnitRegistryRemote.getRegistry(); sceneUnitConfigRemoteRegistry = new SynchronizedRemoteRegistry<>(unitRegistryRemote, UnitRegistryData.SCENE_UNIT_CONFIG_FIELD_NUMBER); } catch (CouldNotPerformException ex) { throw new InstantiationException(this, ex); } }
public UserActivityRegistryRemote() throws InstantiationException, InterruptedException { super(JPUserActivityRegistryScope.class, UserActivityRegistryData.class); try { this.userActivityClassRemoteRegistry = new SynchronizedRemoteRegistry<>(this.getIntenalPriorizedDataObservable(), this, UserActivityRegistryData.USER_ACTIVITY_CLASS_FIELD_NUMBER); this.userActivityConfigRemoteRegistry = new SynchronizedRemoteRegistry<>(this.getIntenalPriorizedDataObservable(), this, UserActivityRegistryData.USER_ACTIVITY_CONFIG_FIELD_NUMBER); } catch (CouldNotPerformException ex) { throw new InstantiationException(this, ex); } }
public DeviceRegistryRemote() throws InstantiationException { super(JPDeviceRegistryScope.class, DeviceRegistryData.class); try { authorizationFilter = new AuthorizationFilter(); deviceClassRemoteRegistry = new SynchronizedRemoteRegistry<>(this.getIntenalPriorizedDataObservable(), this, DeviceRegistryData.DEVICE_CLASS_FIELD_NUMBER); deviceUnitConfigRemoteRegistry = new SynchronizedRemoteRegistry<>(this.getIntenalPriorizedDataObservable(), this, authorizationFilter, DeviceRegistryData.DEVICE_UNIT_CONFIG_FIELD_NUMBER); } catch (CouldNotPerformException ex) { throw new InstantiationException(this, ex); } }
public OpenHABService(final ST unit) throws InstantiationException { try { this.unit = unit; this.repeatCommandTasks = new Future[2]; this.serviceType = detectServiceType(); this.config = loadServiceConfig(); this.itemName = ItemNameLoader.getItemName(this, config); this.openHABRemote = DeviceBindingOpenHABImpl.getInstance().getOpenHABRemote(); } catch (CouldNotPerformException ex) { throw new InstantiationException(this, ex); } }
public LocationRegistryRemote() throws InstantiationException { super(JPLocationRegistryScope.class, LocationRegistryData.class); try { authorizationFilter = new AuthorizationFilter(); this.locationUnitConfigRemoteRegistry = new SynchronizedRemoteRegistry<>(this.getIntenalPriorizedDataObservable(), this, new MockUpFilter(), LocationRegistryData.LOCATION_UNIT_CONFIG_FIELD_NUMBER); this.connectionUnitConfigRemoteRegistry = new SynchronizedRemoteRegistry<>(this.getIntenalPriorizedDataObservable(), this, authorizationFilter, LocationRegistryData.CONNECTION_UNIT_CONFIG_FIELD_NUMBER); } catch (CouldNotPerformException ex) { throw new InstantiationException(this, ex); } }
@Override public SceneRemote newInstance(final UnitConfig config) throws org.openbase.jul.exception.InstantiationException, InterruptedException { try { SceneRemote sceneRemote = Units.getUnit(config, false, Units.SCENE); sceneRemote.addDataObserver((final Observable<SceneData> source, SceneData data) -> { openHABRemote.postUpdate(OpenHABCommandFactory.newOnOffCommand(data.getActivationState()).setItem(generateItemId(config)).build()); }); return sceneRemote; } catch (CouldNotPerformException ex) { throw new org.openbase.jul.exception.InstantiationException(SceneRemote.class, ex); } }
@Override public AppRemote newInstance(final UnitConfig config) throws org.openbase.jul.exception.InstantiationException, InterruptedException { try { AppRemote appRemote = Units.getUnit(config, false, Units.APP); appRemote.addDataObserver((final Observable<AppData> source, AppData data) -> { openHABRemote.postUpdate(OpenHABCommandFactory.newOnOffCommand(data.getActivationState()).setItem(generateItemId(config)).build()); }); return appRemote; } catch (CouldNotPerformException ex) { throw new org.openbase.jul.exception.InstantiationException(AppRemote.class, ex); } }
public AppRegistryController() throws InstantiationException, InterruptedException { super(JPAppRegistryScope.class, AppRegistryData.newBuilder(), SPARSELY_REGISTRY_DATA_NOTIFIED); try { unitRegistryRemote = CachedUnitRegistryRemote.getRegistry(); appClassRegistry = new ProtoBufFileSynchronizedRegistry<>(AppClass.class, getBuilderSetup(), getDataFieldDescriptor(AppRegistryData.APP_CLASS_FIELD_NUMBER), new AppClassIdGenerator(), JPService.getProperty(JPAppClassDatabaseDirectory.class).getValue(), protoBufJSonFileProvider); appUnitConfigRemoteRegistry = new SynchronizedRemoteRegistry<>(unitRegistryRemote, UnitRegistryData.APP_UNIT_CONFIG_FIELD_NUMBER); } catch (JPServiceException | CouldNotPerformException ex) { throw new InstantiationException(this, ex); } }