Class AFRMISocketFactory.PortLease

java.lang.Object
org.newsclub.net.unix.rmi.AFRMISocketFactory.PortLease
All Implemented Interfaces:
Closeable, AutoCloseable
Enclosing class:
AFRMISocketFactory

protected static final class AFRMISocketFactory.PortLease extends Object implements Closeable
A lease on a registered port; closing the lease will return the port.
Author:
Christian Kohlschütter
  • Method Details

    • close

      public void close() throws IOException
      Closes the lease, returning the port to the AFRMIService it was leased from.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getPort

      public int getPort()
      Returns the port number.
      Returns:
      the port number.
    • getRmiService

      public AFRMIService getRmiService()
      Returns the service the port was leased from.
      Returns:
      The service.