Interface SegmentTransmitter

All Superinterfaces:
org.refcodes.component.Closable, org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.ClosedAccessor, org.refcodes.component.ConnectableComponent, org.refcodes.component.ConnectableComponent.ConnectableAutomaton, org.refcodes.component.ConnectionStatusAccessor, Flushable, org.refcodes.component.Flushable, org.refcodes.component.OpenedAccessor, SegmentSource, org.refcodes.io.Transmittable
All Known Subinterfaces:
Port<PM>, SegmentTransceiver, SerialTransceiver, SerialTransmitter
All Known Implementing Classes:
AbstractPort, AbstractPortDecorator, CrossoverLoopbackPort, LoopbackPort

public interface SegmentTransmitter extends SegmentSource, org.refcodes.io.Transmittable
The SegmentTransmitter is used to transmit Segment instances in a unified way.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.refcodes.component.Closable

    org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>

    Nested classes/interfaces inherited from interface org.refcodes.component.ClosedAccessor

    org.refcodes.component.ClosedAccessor.ClosedMutator, org.refcodes.component.ClosedAccessor.ClosedProperty

    Nested classes/interfaces inherited from interface org.refcodes.component.ConnectableComponent

    org.refcodes.component.ConnectableComponent.ConnectableAutomaton

    Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionStatusAccessor

    org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty

    Nested classes/interfaces inherited from interface org.refcodes.component.Flushable

    org.refcodes.component.Flushable.FlushBuilder<B extends org.refcodes.component.Flushable.FlushBuilder<B>>

    Nested classes/interfaces inherited from interface org.refcodes.component.OpenedAccessor

    org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
  • Method Summary

    Modifier and Type
    Method
    Description
    <SEGMENT extends Segment>
    SegmentResult<SEGMENT>
    doTransmitSegment(SEGMENT aSegment)
    Asynchronously sends a Segment's Sequence data (does not block this thread).
    <SEGMENT extends Segment>
    void
    doTransmitSegment(SEGMENT aSegment, SegmentConsumer<SEGMENT> aSegmentConsumer)
    Asynchronously sends a Segment's Sequence data (does not block this thread).
    default void

    Methods inherited from interface org.refcodes.component.Closable

    close, closeIn, closeQuietly, closeUnchecked

    Methods inherited from interface org.refcodes.component.Closable.CloseAutomaton

    isClosable

    Methods inherited from interface org.refcodes.component.ClosedAccessor

    isClosed

    Methods inherited from interface org.refcodes.component.ConnectionStatusAccessor

    getConnectionStatus, isOpened

    Methods inherited from interface org.refcodes.component.Flushable

    flushUnchecked, isFlushable

    Methods inherited from interface org.refcodes.serial.SegmentSource

    transmitSegment
  • Method Details

    • doTransmitSegment

      <SEGMENT extends Segment> void doTransmitSegment(SEGMENT aSegment, SegmentConsumer<SEGMENT> aSegmentConsumer) throws IOException
      Asynchronously sends a Segment's Sequence data (does not block this thread).
      Type Parameters:
      SEGMENT - The Segment type describing the Segment subclass used.
      Parameters:
      aSegment - The Segment to be sent.
      aSegmentConsumer - The callback asynchronously invoked upon having sent the Segment.
      Throws:
      IOException - thrown in case of I/O issues (e.g. a closed connection upon the time of invocation).
    • doTransmitSegment

      <SEGMENT extends Segment> SegmentResult<SEGMENT> doTransmitSegment(SEGMENT aSegment) throws IOException
      Asynchronously sends a Segment's Sequence data (does not block this thread).
      Type Parameters:
      SEGMENT - The Segment type describing the Segment subclass used.
      Parameters:
      aSegment - The Segment to be sent.
      Returns:
      The SegmentResult which provides the result of the operation (asynchronously), e.g. the Segment being sent or an IOException having occurred.
      Throws:
      IOException - thrown in case of I/O issues (e.g. a closed connection upon the time of invocation).
    • flush

      default void flush() throws IOException
      Specified by:
      flush in interface Flushable
      Specified by:
      flush in interface org.refcodes.component.Flushable
      Throws:
      IOException