@Override public <DT> RSBInformer<DT> createSynchronizedInformer(final Scope scope, final Class<DT> type, final ParticipantConfig config) throws InstantiationException { return new RSBSynchronizedInformer<>(scope, type); }
@Override public Class<?> getTypeInfo() throws NotAvailableException { synchronized (participantLock) { try { return getParticipant().getTypeInfo(); } catch (Exception ex) { throw new NotAvailableException("type info", ex); } } }
@Override public Event publish(final DT data) throws CouldNotPerformException, InterruptedException { synchronized (participantLock) { try { // Bugworkaround #2670: Informer socket transport is shutting down if publish trigger thread is marked as interruped // https://code.cor-lab.org/issues/2670 // ========================================= if(Thread.currentThread().isInterrupted()) { throw new InterruptedException(); } // ========================================= return getParticipant().publish(data); } catch (IllegalStateException ex) { throw ExceptionPrinter.printHistoryAndReturnThrowable(new CouldNotPerformException("Fatal error occured!", ex), logger); } catch (CouldNotPerformException | RSBException ex) { throw new CouldNotPerformException("Could not publish Data[" + data + "]!", ex); } } }
@Override public <DT> RSBInformer<DT> createSynchronizedInformer(final Scope scope, final Class<DT> type) throws InstantiationException { return new RSBSynchronizedInformer<>(scope, type); }
@Override public void setTypeInfo(final Class<DT> typeInfo) throws CouldNotPerformException { synchronized (participantLock) { try { if (typeInfo == null) { throw new NotAvailableException("typeInfo"); } getParticipant().setTypeInfo(typeInfo); } catch (Exception ex) { throw new CouldNotPerformException("Could not set type info!", ex); } } } }
@Override public <DT> RSBInformer<DT> createSynchronizedInformer(final String scope, final Class<DT> type, final ParticipantConfig config) throws InstantiationException { return new RSBSynchronizedInformer<>(new Scope(scope), type); }
@Override public Event publish(final Event event) throws CouldNotPerformException, InterruptedException { synchronized (participantLock) { logger.debug("Event[scope=" + event.getScope() + ", type=" + event.getType() + ", metaData=" + event.getMetaData() + "]"); try { if (event == null) { throw new NotAvailableException("event"); } return getParticipant().publish(event); } catch (IllegalStateException | NullPointerException ex) { throw ExceptionPrinter.printHistoryAndReturnThrowable(new CouldNotPerformException("Fatal error occured!", ex), logger); } catch (CouldNotPerformException | RSBException ex) { throw new CouldNotPerformException("Could not publish Event[scope=" + event.getScope() + ", type=" + event.getType() + ", metaData=" + event.getMetaData() + "]!", ex); } } }
@Override public <DT> RSBInformer<DT> createSynchronizedInformer(final String scope, final Class<DT> type) throws InstantiationException { return new RSBSynchronizedInformer<>(new Scope(scope), type); }
informer = new RSBSynchronizedInformer<>(internalScope.concat(new rsb.Scope(rsb.Scope.COMPONENT_SEPARATOR).concat(SCOPE_SUFFIX_STATUS)), Object.class, internalParticipantConfig); informerWatchDog = new WatchDog(informer, "RSBInformer[" + internalScope.concat(new rsb.Scope(rsb.Scope.COMPONENT_SEPARATOR).concat(SCOPE_SUFFIX_STATUS)) + "]");