All Known Implementing Classes:
WsSenderClient

public interface Sender<T>
Represents a sender instance for converted transport data.
Author:
Holger Eichelberger, SSE
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the sender.
    void
    Closes the sender but blocks until closing is done or failed to do so.
    void
    Initiates a connection.
    boolean
    Blocks until connected or failed to do so.
    Returns the URI that this sender is connected to.
    boolean
    Is the state closed.
    boolean
    Is the state open.
    void
    send(T data)
    Sends data to the connected server.
  • Method Details

    • connect

      void connect() throws IOException
      Initiates a connection. This method does not block.
      Throws:
      IOException
    • connectBlocking

      boolean connectBlocking() throws IOException
      Blocks until connected or failed to do so.
      Returns:
      returns whether it succeeded or not.
      Throws:
      IOException - thrown when connection fails, particularly when the blocking thread gets interrupted
    • isOpen

      boolean isOpen()
      Is the state open.
      Returns:
      true for open, false for not open
    • isClosed

      boolean isClosed()
      Is the state closed.
      Returns:
      true for closed, false for not closed
    • send

      void send(T data) throws IOException
      Sends data to the connected server.
      Parameters:
      data - the data that will be transmitted.
      Throws:
      IOException - if the data cannot be send/translated
    • close

      void close()
      Closes the sender. This method does not block.
    • closeBlocking

      void closeBlocking() throws IOException
      Closes the sender but blocks until closing is done or failed to do so.
      Throws:
      IOException - when the closing fails
    • getURI

      URI getURI()
      Returns the URI that this sender is connected to.
      Returns:
      the URI connected to