aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI Server" Watch "RMI Server" New topic

RMI Server

Mark Anderson

Joined: Jun 04, 2002
Posts: 1
I'm using RMI. I have defined all public methods from the Data class (not implementation) in the Remote Interface.
I can't extend from the Data class to my Remote server since the server must extend java.rmi.server.UnicastRemoteObject. Is it a good idea to put the server in the Data class??

Mark A
Eduard Jodas
Ranch Hand

Joined: May 14, 2002
Posts: 80
No, since the Data class is used locally and remotely, it's better to use delegation.
I'm applying an Adapter/Proxy pattern: a server class which extends UnicastRemoteObject, implements the DataRemote interface and pass method calls to a Data instance. In addition, the server class deals with remote lock/unlock.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: RMI Server