/** * {@inheritDoc} * * @return {@inheritDoc} * @throws InitializationException {@inheritDoc} */ @Override protected RSBInformer<TrackedPostures3DFloat> getInitializedInformer() throws InitializationException { try { LOGGER.info("Initializing RSB Informer on scope: " + outScope); if (JPService.getProperty(JPLocalOutput.class).getValue()) { LOGGER.warn("RSB output set to socket and localhost."); return RSBFactoryImpl.getInstance().createSynchronizedInformer(outScope, TrackedPostures3DFloat.class, getLocalConfig()); } else { return RSBFactoryImpl.getInstance().createSynchronizedInformer(outScope, TrackedPostures3DFloat.class); } } catch (CouldNotPerformException | JPNotAvailableException ex) { throw new InitializationException(RSBConnection.class, ex); } }
/** * Constructor initiates the observation of the input unitRemote to detect the state values and send it to the ontology server. * * @param unitRemote contains the state data, which should be observed. * @throws InstantiationException is thrown in case the observation could not be initiated, because at least one component failed. */ public StateObservation(final UnitRemote unitRemote) throws InstantiationException { try { this.unitType = unitRemote.getUnitType(); this.rsbInformer = RSBFactoryImpl.getInstance().createSynchronizedInformer(OntConfig.getOntologyRsbScope(), OntologyChange.class); // this.stopwatch = new Stopwatch(); this.unitRemoteId = unitRemote.getId().toString(); this.connectionPhase = new ConnectionPhase(unitRemote); this.dateFormat = new SimpleDateFormat(OntConfig.DATE_TIME, Locale.getDefault()); createAndAddObserver(unitRemote); } catch (CouldNotPerformException ex) { throw new InstantiationException(this, ex); } }
/** * {@inheritDoc} * * @return {@inheritDoc} * @throws InitializationException {@inheritDoc} */ @Override protected RSBInformer<PointingRay3DFloatDistributionCollection> getInitializedInformer() throws InitializationException { try { Scope outScope = JPService.getProperty(JPPSCBaseScope.class).getValue().concat(JPService.getProperty(JPRayScope.class).getValue()); LOGGER.info("Initializing RSB Informer on scope: " + outScope); if (JPService.getProperty(JPLocalOutput.class).getValue()) { LOGGER.warn("RSB output set to socket and localhost."); return RSBFactoryImpl.getInstance().createSynchronizedInformer(outScope, PointingRay3DFloatDistributionCollection.class, getLocalConfig()); } else { return RSBFactoryImpl.getInstance().createSynchronizedInformer(outScope, PointingRay3DFloatDistributionCollection.class); } } catch (CouldNotPerformException | JPNotAvailableException ex) { throw new InitializationException(RSBConnection.class, ex); } }
/** * {@inheritDoc} * * @return {@inheritDoc} * @throws InitializationException {@inheritDoc} */ @Override protected RSBInformer<UnitProbabilityCollection> getInitializedInformer() throws InitializationException { try { Scope outScope = JPService.getProperty(JPPSCBaseScope.class).getValue().concat(JPService.getProperty(JPSelectedUnitScope.class).getValue()); LOGGER.info("Initializing RSB Informer on scope: " + outScope); if (JPService.getProperty(JPLocalOutput.class).getValue()) { LOGGER.warn("RSB output set to socket and localhost."); return RSBFactoryImpl.getInstance().createSynchronizedInformer(outScope, UnitProbabilityCollection.class, getLocalConfig()); } else { return RSBFactoryImpl.getInstance().createSynchronizedInformer(outScope, UnitProbabilityCollection.class); } } catch (JPNotAvailableException | CouldNotPerformException ex) { throw new InitializationException(RSBConnection.class, ex); } }