Class AdvertiseListenerImpl

java.lang.Object
org.jboss.modcluster.advertise.impl.AdvertiseListenerImpl
All Implemented Interfaces:
AutoCloseable, AdvertiseListener

public class AdvertiseListenerImpl extends Object implements AdvertiseListener
Listens for advertise messages sent by mod_cluster reverse proxy.
Author:
Mladen Turk, Radoslav Husar
  • Field Details

  • Constructor Details

    • AdvertiseListenerImpl

      public AdvertiseListenerImpl(MCMPHandler commHandler, AdvertiseConfiguration config, DatagramChannelFactory channelFactory) throws IOException
      Constructors a new AdvertiseListenerImpl
      Parameters:
      commHandler - event handler that will be used for status and new server notifications
      config - advertise configuration
      channelFactory - a multicast channel factory
      Throws:
      IOException
  • Method Details

    • getServer

      public AdvertisedServer getServer(String name)
      Get AdvertiseServer server.
      Parameters:
      name - Server name to get.
    • close

      public void close() throws IOException
      Stops the advertise listener.
      Specified by:
      close in interface AdvertiseListener
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException - If an I/O error occurs while closing the underlying channel.
      See Also:
    • isListening

      public boolean isListening()
      Description copied from interface: AdvertiseListener
      Returns true if listener is accepting the advertise messages; false if the listener was stopped or is experiencing network problems.
      Specified by:
      isListening in interface AdvertiseListener
    • flipBuffer

      public static void flipBuffer(Buffer buffer)
      JDK-compatible flip operating on Buffer instead of ByteBuffer. See MODCLUSTER-743.
      Parameters:
      buffer - a buffer to flip
    • clearBuffer

      public static void clearBuffer(Buffer buffer)
      JDK-compatible clear operating on Buffer instead of ByteBuffer. See MODCLUSTER-743.
      Parameters:
      buffer - a buffer to clear