Service providing an interface to the local machine resources where ReadyAPI is running.
| Type Params | Return Type | Name and description |
|---|---|---|
|
int |
findFreePortStartingFrom(int port)Attempts to find a free port starting from the given port, then increasing by one until a free port is found. |
|
java.util.Set<java.lang.String> |
getLocalHostsAddresses()Get addresses of the localhost |
|
boolean |
isPortFree(int port)To know if a port is free or used |
|
boolean |
isValidPort(int port)
|
|
java.nio.channels.FileLock |
tryAcquireLock(java.lang.String lockName)Try to acquire a lock. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Attempts to find a free port starting from the given port, then increasing by one until a free port is found.
A valid port (0 < port number <= 65535) number equal to or larger than the initial number given is returned unless none can be found, in which case an Exception is thrown.port - the initial port to try. If (port < 0) or (port > 65535) ReadyApiException is thrown immediatelyGet addresses of the localhost
To know if a port is free or used
Try to acquire a lock. The lock only gets returned if it was successfully acquired. An Exception is thrown if the lock cannot be acquired for any reason.
lockName - will become a file at \${READY_API_HOME_DIR}/lockName.lock