This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI object" Watch "RMI object" New topic
Author

RMI object

Jimmy Hu
Greenhorn

Joined: Feb 05, 2001
Posts: 17
This is related to the assignment. But I am trying to address it in more general way.
RMI object created in server side cannot take any parameters from client side. What I can think of is to create a member method to take the parameters from client and change the original constructor to do nothing signicant but create a RMI object. The side effect is this imposes some order of executing the member methods of remote object. Do you know the better way to handle it?
Thanks
Jimmy


Jimmy
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Jimmy,

RMI object created in server side cannot take any parameters from client side.

Why not? What RMI object are you talking about? You can always use some sort of static factory method to construct objects across RMI.
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Jimmy Hu
Greenhorn

Joined: Feb 05, 2001
Posts: 17
In the server side of RMI, you create a remote object and then use "Naming.rebind(...)" to publish the remote object. When you create the remote object, "rebind" doesn't happen yet. How do you get some parameters from client side to create the remote object?
E.g. I need the database information to create a a Data object in server side.
Looking forward to your response.
Thanks
Jimmy
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Jimmy,
Not all RMI objects have to be bound to the registry with Naming.rebind(). As I was saying you could bind some sort of factory object to the registry which could then create some other RMI object based on parameters passed to it from the client. The parameters of course must be primitives, Serializable or Remote objects.
Hope this helps,
Michael Morris
Jimmy Hu
Greenhorn

Joined: Feb 05, 2001
Posts: 17
Michael,
Thanks for your help.
Looks like my knowledge on RMI is very limited -- only from Sun's RMI tutorial.
I need to read more .
 
 
subject: RMI object