Package org.jgroups.util
Class ResourceManager
java.lang.Object
org.jgroups.util.ResourceManager
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface(package private) static classRepresentation of an IPv4 address(package private) static classRepresentation of an IPv6 address -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static shortprivate static final ResourceManager.IpAddressRepprivate static final SocketFactoryprivate static int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturns the next available multicast address, e.g.static shortgetNextMulticastPort(InetAddress bind_addr) static intgetNextTcpPort(InetAddress bind_addr) private static intgetNextTCPPort(InetAddress bind_addr, int start_port) getNextTcpPorts(InetAddress bind_addr, int num_requested_ports) static void
-
Field Details
-
rep
-
mcast_port
private static short mcast_port -
tcp_port
private static int tcp_port -
socket_factory
-
-
Constructor Details
-
ResourceManager
private ResourceManager()
-
-
Method Details
-
getNextMulticastAddress
Returns the next available multicast address, e.g. "239.1.2.3". This class is a JVM singleton- Returns:
-
getNextMulticastPort
- Throws:
Exception
-
getNextTcpPorts
public static List<Integer> getNextTcpPorts(InetAddress bind_addr, int num_requested_ports) throws Exception - Throws:
Exception
-
getNextTcpPort
- Throws:
Exception
-
getNextTCPPort
- Throws:
Exception
-
main
- Throws:
Exception
-