wood burning stoves*
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
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI Server" Watch "RMI Server" New topic
Author

RMI Server

Mark Anderson
Greenhorn

Joined: Jun 04, 2002
Posts: 1
Hi,
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
 
Similar Threads
Adapter pattern for RMI
The RMI Data Access Conundrum
NX:contractor - stubs
Passed with a 142
UniCastRemoteObject