Interface RtTransport

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.List<? extends java.lang.Object> clusterMembers()
      Returns the addresses of all cluster members.
      java.lang.Object localAddress()
      Returns the local addres of this member.
      java.lang.String[] options()
      Prints the accepted options, e.g.
      void options​(java.lang.String... options)
      Sets options on this transport.
      void receiver​(RtReceiver receiver)
      Sets the receiver whose RtReceiver.receive(Object,byte[],int,int) callback will be invoked whenever a message is received
      void send​(java.lang.Object dest, byte[] buf, int offset, int length)
      Sends a message
      void start​(java.lang.String... options)
      Starts the transport, e.g.
      void stop()
      Stops the transport, e.g.
    • Method Detail

      • options

        java.lang.String[] options()
        Prints the accepted options, e.g. [-host host] [-port port] [-server host]
        Returns:
      • options

        void options​(java.lang.String... options)
              throws java.lang.Exception
        Sets options on this transport. Usually done after creation and before start(String...) is called, but may also be called at runtime.
        Parameters:
        options - The options
        Throws:
        java.lang.Exception
      • localAddress

        java.lang.Object localAddress()
        Returns the local addres of this member.
        Returns:
        The local address. Implementations without cluster membership may return null
      • clusterMembers

        java.util.List<? extends java.lang.Object> clusterMembers()
        Returns the addresses of all cluster members. May return null if not implemented
        Returns:
        The list of all members in the cluster
      • start

        void start​(java.lang.String... options)
            throws java.lang.Exception
        Starts the transport, e.g. connecting to a server socket
        Parameters:
        options - Options passed to the transport at startup time. May be null
        Throws:
        java.lang.Exception
      • stop

        void stop()
        Stops the transport, e.g. stopping the accept() loop in a TCP-based server
      • send

        void send​(java.lang.Object dest,
                  byte[] buf,
                  int offset,
                  int length)
           throws java.lang.Exception
        Sends a message
        Parameters:
        dest - The destination address
        buf - The buffer
        offset - The offset at which the data starts
        length - The length (in bytes) of the data to send
        Throws:
        java.lang.Exception