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 TypeMethodDescriptionvoidclose()Closes the lease, returning the port to theAFRMIServiceit was leased from.intgetPort()Returns the port number.Returns the service the port was leased from.
-
Method Details
-
close
Closes the lease, returning the port to theAFRMIServiceit was leased from.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein 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.
-