Class ServerPort

  • Direct Known Subclasses:
    KarafInstancePort

    public class ServerPort
    extends Object
    This immutable class contains information on variable port that is assigned by this class. This class will use the PortAssigner to assign a port from the defined range, when the #assignPort() is called. The port will be considered reserved for the duration of JVM, unless the releasePort() is called.
    Author:
    tkafalas
    • Constructor Detail

      • ServerPort

        public ServerPort​(String id,
                          String friendlyName,
                          Integer startPort)
        Parameters:
        id - A unique Id associated with this port
        friendlyName - A friendly descriptive name associated with this port
        startPort - The first port number in a range of available ports. If null an unused port ill be assigned.
      • ServerPort

        public ServerPort​(String id,
                          String friendlyName,
                          Integer startPort,
                          String serviceName)
        Parameters:
        id - A unique Id associated with this port
        friendlyName - A friendly descriptive name associated with this port
        startPort - The first port number in a range of available ports. If null an unused port ill be assigned.
        serviceName - The serviceName associated with this port
    • Method Detail

      • getId

        public String getId()
      • getAssignedPort

        public Integer getAssignedPort()
      • setAssignedPort

        public void setAssignedPort​(Integer assignedPort)
      • getFriendlyName

        public String getFriendlyName()
      • setFriendlyName

        protected void setFriendlyName​(String friendlyName)
      • getStartPort

        public Integer getStartPort()
      • getServiceName

        public String getServiceName()
      • releasePort

        public void releasePort()
        Free's up the port resource for re-use. Call this method when the port can be reused.