Hello, All remote Clients of my application have access to one DataRemote object for database connectivity. I have used an RMIFactory for gaining access to the DataRemote object, my thought is that: should I completely remove the RMIFactory and gain direct access to the DataRemote object in the RMI registry since I only have one DataRemote object available to all Clients or should I just leave the RMIFactory? Your thoughts please.
You can use the UnicastRemoteObject.unexportObject static method, but this is not a must. What is important in this case is that the Data Access Layer is "clear" closed. Any attempt to operate a closed Data Access Layer must end with an Exception. So if you close the the Data Access Layer you can still keep the remote connection because if a client try to use it he will get an Exception. More if you remove the remote factory from the rmi registry the clients are still active - they still have the remote connections. So you need to remove two stuff from the rmi registry :
on the server remove the factory - no other new clients can be created, but all the actual are still active an they can still access the Data Access Layer.
on the (remote) client side the client it self - in this case the client can not make remote requests.
But once more this rmi unregister steep is optional, what is important is that your Data Access Layer is closed.
Regards M [ April 13, 2007: Message edited by: Mihai Radulescu ]
SCJP, SCJD, SCWCD, OCPJBCD
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads