Package org.apache.pulsar.common.util
Class PortManager
java.lang.Object
org.apache.pulsar.common.util.PortManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkPortIfLocked
(int lockedPort) Check port if locked.static int
Return a locked available port.static boolean
releaseLockedPort
(int lockedPort) Returns whether the port was released successfully.
-
Constructor Details
-
PortManager
public PortManager()
-
-
Method Details
-
nextLockedFreePort
public static int nextLockedFreePort()Return a locked available port.- Returns:
- locked available port.
-
releaseLockedPort
public static boolean releaseLockedPort(int lockedPort) Returns whether the port was released successfully.- Returns:
- whether the release is successful.
-
checkPortIfLocked
public static boolean checkPortIfLocked(int lockedPort) Check port if locked.- Returns:
- whether the port is locked.
-