This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird - Remote Access

 
Bod Toki
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bod

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 ]
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic