Class JGroupsTransport

    • Field Detail

      • view

        protected View view
      • oob

        protected boolean oob
      • dont_bundle

        protected boolean dont_bundle
      • log

        protected final Log log
    • Constructor Detail

      • JGroupsTransport

        public JGroupsTransport()
    • Method Detail

      • options

        public java.lang.String[] options()
        Description copied from interface: RtTransport
        Prints the accepted options, e.g. [-host host] [-port port] [-server host]
        Specified by:
        options in interface RtTransport
        Returns:
      • options

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

        public Address localAddress()
        Description copied from interface: RtTransport
        Returns the local addres of this member.
        Specified by:
        localAddress in interface RtTransport
        Returns:
        The local address. Implementations without cluster membership may return null
      • clusterMembers

        public java.util.List<Address> clusterMembers()
        Description copied from interface: RtTransport
        Returns the addresses of all cluster members. May return null if not implemented
        Specified by:
        clusterMembers in interface RtTransport
        Returns:
        The list of all members in the cluster
      • start

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

        public void stop()
        Description copied from interface: RtTransport
        Stops the transport, e.g. stopping the accept() loop in a TCP-based server
        Specified by:
        stop in interface RtTransport
      • send

        public void send​(java.lang.Object dest,
                         byte[] buf,
                         int offset,
                         int length)
                  throws java.lang.Exception
        Description copied from interface: RtTransport
        Sends a message
        Specified by:
        send in interface RtTransport
        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
      • receive

        public void receive​(MessageBatch batch)
        Description copied from interface: Receiver
        Called when a batch of messages is received
        Specified by:
        receive in interface Receiver
        Parameters:
        batch - The message batch
      • receive

        public void receive​(Message msg)
        Description copied from interface: Receiver
        Called when a message is received.
        Specified by:
        receive in interface Receiver
        Parameters:
        msg - The message
      • viewAccepted

        public void viewAccepted​(View view)
        Description copied from interface: Receiver
        Called when a change in membership has occurred. No long running actions, sending of messages or anything that could block should be done in this callback. If some long running action needs to be performed, it should be done in a separate thread.
        Note that on reception of the first view (a new member just joined), the channel will not yet be in the connected state. This only happens when JChannel.connect(String) returns.
        Specified by:
        viewAccepted in interface Receiver