> 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.
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