public class PortUtils extends Object
Constructor and Description |
---|
PortUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
checkPorts(boolean failIfTaken,
String prefix,
List<Integer> ports)
Iterate through the ports and log whether each is available
|
static List<Integer> |
findFreePorts(int numberOfPorts)
Find a given number of available ports
|
static boolean |
isPortFree(int port)
Check and log is a given port is available
|
public static List<Integer> findFreePorts(int numberOfPorts)
numberOfPorts
- The number of free ports to findpublic static void checkPorts(boolean failIfTaken, String prefix, List<Integer> ports) throws Exception
failIfTaken
- If true, fails the current test if the port is not availableException
public static boolean isPortFree(int port)
port
- the port number to checkCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.