Class Bridge

  • All Implemented Interfaces:
    Receiver

    public class Bridge
    extends java.lang.Object
    implements Receiver
    Class which joins the bridge cluster and send and receives messages to/from other sites. Also generates sitesUp()/sitesDown() notifications from view changes
    Since:
    5.2.17
    Author:
    Bela Ban
    • Field Detail

      • channel

        protected final JChannel channel
      • relay

        protected final RELAY relay
      • log

        protected final Log log
      • cluster_name

        protected final java.lang.String cluster_name
      • view

        protected View view
      • join_timeout

        protected final long join_timeout
    • Constructor Detail

      • Bridge

        protected Bridge​(JChannel ch,
                         Relayer3 r,
                         java.lang.String cluster_name,
                         java.lang.String channel_name,
                         AddressGenerator addr_generator)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • start

        protected void start()
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • stop

        protected void stop()
      • 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 new_view)
        The view contains a list of SiteUUIDs. Adjust the routing table based on the SiteUUIDs and site
        Specified by:
        viewAccepted in interface Receiver
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • contains

        protected static boolean contains​(java.util.List<Route> routes,
                                          Address addr)
      • removedRoutes

        protected static java.util.List<java.lang.String> removedRoutes​(View old_view,
                                                                        View new_view)
        Returns a list of routes that were in old_view, but are no longer in new_view