Connecting Tech Pros Worldwide Forums | Help | Site Map

RMI - Pass data within clients

Familiar Sight
 
Join Date: Jan 2007
Posts: 168
#1: Jul 20 '07
Dear Experts,

I am new to RMI, On my application i having 2 clients and an server.

Frist client gets data from User.
Second client Process the data (which was received by first client)
Result is displayed and First client only (Where input was received)

Server is responsible for passing the input / output data only.

Is it possible to be implemented using RMI ??
Advance Thanks,
Rengaraj.R

JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#2: Jul 20 '07

re: RMI - Pass data within clients


Quote:

Originally Posted by rengaraj

Dear Experts,

I am new to RMI, On my application i having 2 clients and an server.

Frist client gets data from User.
Second client Process the data (which was received by first client)
Result is displayed and First client only (Where input was received)

Server is responsible for passing the input / output data only.

Is it possible to be implemented using RMI ??
Advance Thanks,
Rengaraj.R

Sure, if you can do it in one JVM (all classes in that JVM) you can do it
using RMI and multiple JVMs; just make sure that the data you pass from
class to class implements the Serializable interface.

kind regards,

Jos
Familiar Sight
 
Join Date: Jan 2007
Posts: 168
#3: Jul 20 '07

re: RMI - Pass data within clients


Quote:

Originally Posted by JosAH

Sure, if you can do it in one JVM (all classes in that JVM) you can do it
using RMI and multiple JVMs; just make sure that the data you pass from
class to class implements the Serializable interface.

kind regards,

Jos

Thanks Jos,
I haven't tested even on one JVM. I hope my implementing serializable interface we can pass data from one client window to another client window.

If you have any example please give me.
Advance Thanks
Rengaraj.R
JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#4: Jul 20 '07

re: RMI - Pass data within clients


Quote:

Originally Posted by rengaraj

Thanks Jos,
I haven't tested even on one JVM. I hope my implementing serializable interface we can pass data from one client window to another client window.

If you have any example please give me.
Advance Thanks
Rengaraj.R

Implementing the Serializable interface is easy: it's a "marker" interface so there's
nothing to implement. Read Sun's RMI Tutorial and do the exercise and see how
it all works: the rmic compiler generates stub classes for you and your client
side simply talks to the stub(s). The server side registers itself at a naming
service and that's it. Your actual code stays the same and there you've got your
RMI communication.

kind regards,

Jos
Reply