@ThreadSafe public class AvailablePortFinder extends Object
| Constructor and Description |
|---|
AvailablePortFinder() |
| Modifier and Type | Method and Description |
|---|---|
static AvailablePortFinder |
createPrivate()
Creates a port finder that operates on private ports.
|
int |
getNextAvailable()
Gets the next available port.
|
public static AvailablePortFinder createPrivate()
public int getNextAvailable()
Tries to avoid returning the same port on successive invocations (but it may happen if no other available ports are found).
NoSuchElementException - if no available port is foundCopyright © 2013. All rights reserved