Module org.newsclub.net.unix.rmi
Package org.newsclub.net.unix.rmi
Class AFRMISocketFactory.PortLease
java.lang.Object
org.newsclub.net.unix.rmi.AFRMISocketFactory.PortLease
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
AFRMISocketFactory
A lease on a registered port; closing the lease will return the port.
- Author:
- Christian Kohlschütter
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the lease, returning the port to theAFRMIService
it was leased from.int
getPort()
Returns the port number.Returns the service the port was leased from.
-
Method Details
-
close
Closes the lease, returning the port to theAFRMIService
it was leased from.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
getPort
public int getPort()Returns the port number.- Returns:
- the port number.
-
getRmiService
Returns the service the port was leased from.- Returns:
- The service.
-