Class ObservableSectionDecorator<DECORATEE extends org.refcodes.serial.Section>

    • Constructor Detail

      • ObservableSectionDecorator

        public ObservableSectionDecorator​(DECORATEE aDecoratee)
        Constructs a ObservableSection wrapping the given Section decoratee and using a default ExecutorService and dispatching events in sequentially (as of ExecutionStrategy.SEQUENTIAL).
        Parameters:
        aDecoratee - The decoratee to be wrapped by the observable decorator.
      • ObservableSectionDecorator

        public ObservableSectionDecorator​(DECORATEE aDecoratee,
                                          org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
        Constructs a ObservableSection wrapping the given Section decoratee and using the provided ExecutionStrategy when dispatching the events.
        Parameters:
        aDecoratee - The decoratee to be wrapped by the observable decorator.
        aExecutionStrategy - the execution strategy to use when dispatching events.
      • ObservableSectionDecorator

        public ObservableSectionDecorator​(DECORATEE aDecoratee,
                                          ExecutorService aExecutorService,
                                          org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
        Constructs a ObservableSection wrapping the given Section decoratee and using the provided ExecutorService when dispatching events in parallel (as of ExecutionStrategy.PARALLEL and ExecutionStrategy.JOIN) and using the given ExecutionStrategy when dispatching the events.
        Parameters:
        aDecoratee - The decoratee to be wrapped by the observable decorator.
        aExecutorService - the executor service to use when dispatching events.
        aExecutionStrategy - the execution strategy to use when dispatching events.
    • Method Detail

      • fromTransmission

        public void fromTransmission​(org.refcodes.serial.Sequence aSequence,
                                     int aOffset,
                                     int aLength)
                              throws org.refcodes.serial.TransmissionException
        Specified by:
        fromTransmission in interface org.refcodes.serial.Section
        Throws:
        org.refcodes.serial.TransmissionException
      • receiveFrom

        public void receiveFrom​(InputStream aInputStream,
                                int aLength,
                                OutputStream aReturnStream)
                         throws IOException,
                                org.refcodes.serial.TransmissionException
        Specified by:
        receiveFrom in interface org.refcodes.serial.Section
        Throws:
        IOException
        org.refcodes.serial.TransmissionException
      • getLength

        public int getLength()
        Specified by:
        getLength in interface org.refcodes.mixin.LengthAccessor
        Specified by:
        getLength in interface org.refcodes.serial.Transmission
      • toTransmission

        public org.refcodes.serial.Sequence toTransmission()
        Specified by:
        toTransmission in interface org.refcodes.serial.Transmission
      • toSchema

        public org.refcodes.serial.Schema toSchema()
        Specified by:
        toSchema in interface org.refcodes.serial.Transmission
      • toSimpleTypeMap

        public org.refcodes.struct.SimpleTypeMap toSimpleTypeMap()
        Specified by:
        toSimpleTypeMap in interface org.refcodes.serial.Transmission
      • getDecoratee

        public DECORATEE getDecoratee()
        Specified by:
        getDecoratee in interface org.refcodes.mixin.DecorateeAccessor<DECORATEE extends org.refcodes.serial.Section>
      • hasObserverSubscription

        public boolean hasObserverSubscription​(TransmissionObserver<DECORATEE> aObserver)
        Specified by:
        hasObserverSubscription in interface org.refcodes.observer.Observable<DECORATEE extends org.refcodes.serial.Section>
      • subscribeObserver

        public boolean subscribeObserver​(TransmissionObserver<DECORATEE> aObserver)
        Specified by:
        subscribeObserver in interface org.refcodes.observer.Observable<DECORATEE extends org.refcodes.serial.Section>
      • unsubscribeObserver

        public boolean unsubscribeObserver​(TransmissionObserver<DECORATEE> aObserver)
        Specified by:
        unsubscribeObserver in interface org.refcodes.observer.Observable<DECORATEE extends org.refcodes.serial.Section>