Class ResourceManager

java.lang.Object
org.jgroups.util.ResourceManager

public class ResourceManager extends Object
Manages resources such as multicast addresses and multicast ports, and TCP ports. This class is mainly used for running unit tests in parallel (TestNG) and preventing clusters intended to be separate from joining each other.
Author:
Bela Ban
  • Method Details

    • getNextMulticastAddress

      public static String getNextMulticastAddress()
      Returns the next available multicast address, e.g. "228.1.2.3". This class is a JVM singleton
      Returns:
    • getNextMulticastPort

      public static short getNextMulticastPort(InetAddress bind_addr) throws Exception
      Throws:
      Exception
    • getNextTcpPorts

      public static List<Short> getNextTcpPorts(InetAddress bind_addr, int num_requested_ports) throws Exception
      Throws:
      Exception
    • getUniqueClusterName

      public static String getUniqueClusterName(String base_name)
    • getUniqueClusterName

      public static String getUniqueClusterName()
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception