/** * {@inheritDoc} * * @param arguments {@inheritDoc} * @return {@inheritDoc} * @throws JPBadArgumentException {@inheritDoc} */ @Override protected Scope parse(List<String> arguments) throws JPBadArgumentException { String oneArgumentResult = getOneArgumentResult(); try { return new Scope(oneArgumentResult); } catch (IllegalArgumentException ex) { throw new JPBadArgumentException("Given Scope[" + oneArgumentResult + "] is not a Scope.", 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 RSBListener getInitializedListener() throws InitializationException { try { Scope inScope = JPService.getProperty(JPPSCBaseScope.class).getValue().concat(JPService.getProperty(JPPostureScope.class).getValue()); LOGGER.info("Initializing RSB Listener on scope: " + inScope); if (JPService.getProperty(JPLocalInput.class).getValue()) { LOGGER.warn("RSB input set to socket and localhost."); return RSBFactoryImpl.getInstance().createSynchronizedListener(inScope, getLocalConfig()); } else { return RSBFactoryImpl.getInstance().createSynchronizedListener(inScope); } } catch (CouldNotPerformException | JPNotAvailableException ex) { throw new InitializationException(RSBConnection.class, ex); } }
/** * {@inheritDoc} * * @return {@inheritDoc} * @throws InitializationException {@inheritDoc} */ @Override protected RSBListener getInitializedListener() throws InitializationException { try { Scope selectedUnitScope = JPService.getProperty(JPPSCBaseScope.class).getValue().concat(JPService.getProperty(JPSelectedUnitScope.class).getValue()); LOGGER.info("Initializing RSB Selected Unit Listener on scope: " + selectedUnitScope); if (JPService.getProperty(JPLocalInput.class).getValue()) { LOGGER.warn("RSB input set to socket and localhost."); return RSBFactoryImpl.getInstance().createSynchronizedListener(selectedUnitScope, getLocalConfig()); } else { return RSBFactoryImpl.getInstance().createSynchronizedListener(selectedUnitScope); } } catch (CouldNotPerformException | JPNotAvailableException ex) { throw new InitializationException(RSBConnection.class, ex); } }
/** * {@inheritDoc} * * @return {@inheritDoc} * @throws InitializationException {@inheritDoc} */ @Override protected RSBListener getInitializedListener() throws InitializationException { try { Scope inScope = JPService.getProperty(JPPSCBaseScope.class).getValue().concat(JPService.getProperty(JPRayScope.class).getValue()); LOGGER.info("Initializing RSB Listener on scope: " + inScope); if (JPService.getProperty(JPLocalInput.class).getValue()) { return RSBFactoryImpl.getInstance().createSynchronizedListener(inScope, getLocalConfig()); } else { return RSBFactoryImpl.getInstance().createSynchronizedListener(inScope); } } 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); } }
/** * {@inheritDoc} * * @return {@inheritDoc} * @throws InitializationException {@inheritDoc} */ @Override protected RSBListener getInitializedListener() throws InitializationException { try { LOGGER.info("Initializing RSB Listener on scope: " + baseScope); if (JPService.getProperty(JPLocalInput.class).getValue()) { LOGGER.warn("RSB input set to socket and localhost."); return RSBFactoryImpl.getInstance().createSynchronizedListener(baseScope, getLocalConfig()); } else { return RSBFactoryImpl.getInstance().createSynchronizedListener(baseScope); } } catch (CouldNotPerformException | JPNotAvailableException ex) { throw new InitializationException(RSBConnection.class, ex); } }
/** * {@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); } }
@Override public void init() throws InitializationException, InterruptedException { if (!initialized) { try { initSelector(); registryFlags = JPService.getProperty(JPPscUnitFilterList.class).getValue(); initializeRegistryConnection(); rsbConnection = new RSBConnection(this); rsbConnection.init(); initialized = true; } catch (JPNotAvailableException | CouldNotPerformException ex) { throw new InitializationException(IdentificationController.class, ex); } } }
/** * {@inheritDoc} * * @throws InitializationException {@inheritDoc} * @throws InterruptedException {@inheritDoc} */ @Override public void init() throws InitializationException, InterruptedException { if (!initialized) { try { LOGGER.info("Initializing ControlController."); controllableObjectRegistry = new SynchronizableRegistryImpl<>(); registryFlags = JPService.getProperty(JPPscUnitFilterList.class).getValue(); LOGGER.info("Selected Control Registry flags: " + registryFlags.toString()); threshold = JPService.getProperty(JPControlThreshold.class).getValue(); LOGGER.info("Selected Control threshold: " + threshold); initializeRegistryConnection(); rsbConnection = new RSBConnection(this); rsbConnection.init(); initialized = true; } catch (JPNotAvailableException | CouldNotPerformException ex) { throw new InitializationException(ControlController.class, ex); } } }