public final class AvailablePortFinder extends Object
Finds currently available server ports.
This class is a verbatim copy of AvailablePortFinder from the camel-test component of the Apache Camel project.
Modifier and Type | Field and Description |
---|---|
static int |
MAX_PORT_NUMBER
The maximum server currentMinPort number.
|
static int |
MIN_PORT_NUMBER
The minimum server currentMinPort number.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
available(int port)
Checks to see if a specific currentMinPort is available.
|
static int |
getNextAvailable()
Gets the next available currentMinPort starting at the lowest currentMinPort number.
|
static int |
getNextAvailable(int fromPort)
Gets the next available currentMinPort starting at a currentMinPort.
|
public static final int MIN_PORT_NUMBER
public static final int MAX_PORT_NUMBER
public static int getNextAvailable()
NoSuchElementException
- if there are no ports availablepublic static int getNextAvailable(int fromPort)
fromPort
- the currentMinPort to scan for availabilityNoSuchElementException
- if there are no ports availablepublic static boolean available(int port)
port
- the currentMinPort to check for availabilityCopyright © 2005–2016 The Kuali Foundation. All rights reserved.