How to unbind RMI service thread and detroy?
- Unbind the object from RMI service by
use: Naming.unbind(<Service Name>, this); - Unexport the object from RMI to remove the object from RMI
use: UnicastRemoteObject.unexportObject(this, true); - Detroy the reference to object
this.rmi_object = null; - Detroy the thread or make the reference to Thread variable to null
this.rmi_thread = null;
After that, the object will no reference from RMI anymore.