Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

need Help in reflect an RMI object

Thread view: 
fAnSKyer - 27 Sep 2006 23:46 GMT
I want to reflect an RMI object. and save the values of each variable
using field.

However I can only get the interface of the RMI object.

If I reflect the interface, I can't get the what I need. But I don't
know how to reflect the RMI object.

Can anybody help me? Thanks a lot, fAnS
EJP - 28 Sep 2006 01:13 GMT
> I want to reflect an RMI object. and save the values of each variable
> using field.
[quoted text clipped - 3 lines]
> If I reflect the interface, I can't get the what I need. But I don't
> know how to reflect the RMI object.

You can only do that from inside the JVM where the remote object was
exported from, because that's where the variables are, and you need a
reference to the actual object, not to the stub.

If you're in another JVM and all you have is the stub, all you can
usefully do is call remote methods on the stub, and you don't need
reflection for that.
fAnSKyer - 28 Sep 2006 01:34 GMT
EJP 写道:

> > I want to reflect an RMI object. and save the values of each variable
> > using field.
[quoted text clipped - 7 lines]
> exported from, because that's where the variables are, and you need a
> reference to the actual object, not to the stub.
Actually how can I get a reference to a actual object?
When I using RMI naming.lookup and I only get a interface..

> If you're in another JVM and all you have is the stub, all you can
> usefully do is call remote methods on the stub, and you don't need
> reflection for that.
I can call remote methods, but what I need is the values for the
variables? Can you tell me how to write a remote methods to get these
Variables? I doubt in this situation I have to use reflect?

Thanks a lot, FanS
Rodrigo Zechin - 28 Sep 2006 16:47 GMT
Man, don't try to use reflection on RMI objects, just create a getter
for the fields you want to retrieve and call the getter.

(you will need to add it in the interface:)
int getField() throws RemoteException;

RZR

> I can call remote methods, but what I need is the values for the
> variables? Can you tell me how to write a remote methods to get these
> Variables? I doubt in this situation I have to use reflect?
>
> Thanks a lot, FanS
fAnSKyer - 02 Oct 2006 04:51 GMT
Thanks a lot :P

> Man, don't try to use reflection on RMI objects, just create a getter
> for the fields you want to retrieve and call the getter.
[quoted text clipped - 9 lines]
> >
> > Thanks a lot, FanS


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.