Package org.apache.camel.test
Class AvailablePort
java.lang.Object
org.apache.camel.test.AvailablePort
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intprobePort(InetAddress address, int port) Probe a port to see if it is free
-
Constructor Details
-
AvailablePort
public AvailablePort()
-
-
Method Details
-
probePort
Probe a port to see if it is free- Parameters:
port- an integer port number to be tested. If port is 0, then the next available port is returned.- Returns:
- the port number itself if the port is free or, in case of port 0, the first available port number.
- Throws:
IllegalStateException- if the port is not free or, in case of port 0, if there are no ports available at all.
-