- All Superinterfaces:
- Remote
The 
AFRMIService assigns and keeps track of anonymous ports, among other things.
 This feature is to be used by AFRMISocketFactory only.- Author:
- Christian Kohlschütter
- 
Method SummaryModifier and TypeMethodDescriptionbooleanIndicates whether a remote-shutdown of the RMI registry is allowed.intnewPort()Registers a new anonymous port and returns it.Returns a stream of open ports.voidregisterForShutdown(Closeable closeable) Adds the givenCloseableto the list of instances to be closed upon shutdown of the RMI registry.voidreturnPort(int port) Returns a previously registered port.voidshutdown()Asks that this RMI registry gets shut down.voidunregisterForShutdown(Closeable closeable) Removes the givenCloseablefrom the list of instances to be closed upon shutdown of the RMI registry.
- 
Method Details- 
newPortRegisters a new anonymous port and returns it. When the port is not required anymore, it must be returned viareturnPort(int).- Returns:
- The new port.
- Throws:
- IOException- if the operation fails.
 
- 
returnPortReturns a previously registered port. No error is thrown if the given port has not been assigned before.- Parameters:
- port- The port.
- Throws:
- IOException- if the operation fails.
 
- 
openPortsReturns a stream of open ports.- Returns:
- A sequence of open ports.
- Throws:
- RemoteException- if the operation fails.
 
- 
isShutdownAllowedIndicates whether a remote-shutdown of the RMI registry is allowed. NOTE: A call toshutdown()may or may not succeed regardless.- Returns:
- Indication of whether a remote-shutdown of the RMI registry is allowed.
- Throws:
- RemoteException- if the operation fails.
 
- 
shutdownAsks that this RMI registry gets shut down.- Throws:
- RemoteException- if the operation fails.
 
- 
registerForShutdownAdds the givenCloseableto the list of instances to be closed upon shutdown of the RMI registry.- Parameters:
- closeable- The instance.
- Throws:
- RemoteException- if the operation fails.
 
- 
unregisterForShutdownRemoves the givenCloseablefrom the list of instances to be closed upon shutdown of the RMI registry. No error is returned if the given element was not registered before.- Parameters:
- closeable- The instance.
- Throws:
- RemoteException- if the operation fails.
 
 
-