-
1. Re: remote object data and behavior
tom.elrod Jan 17, 2005 11:18 AM (in response to xiangya)Hmm. Not sure I fully understand what you are asking, but will take a stab at what I thinking you are looking for.
There are two ways in which to pass (or receive) objects in any remote call; by reference and by value. By value means that the object being passed is actually marshalled over the network, including all its state information. The end result of passing an object by value is that there will be two instances of that ojbect in memory; one within the client's vm and one within the server's vm. When the receiver of the remote call (the server) gets this object passed by value, it will act on this object locally. So this means if the server sets a value on an object passed to it, the client will not be aware of this change.
The other way, pass by reference, means that the actual object instance is not passed across the wire, but instead, a remote proxy of it. So when the server gets passed the proxy, it will appear to the server that it is making calls locally on the object, but for each call it makes, the proxy will make the call across the network to the original object in memory on the client. Thus is there is only one instances being maintained, which is in the client vm.
Hope this is what you were asking for?
-Tom -
2. Re: remote object data and behavior
xiangya Jan 18, 2005 12:41 PM (in response to xiangya)Sorry for my bum-english. I can not state clearly what I mean.
In fact, I hope current Remote Object used by this pattern:
pass to client's vm by reference and pass the same remote object's state information to client by value.
so this senario looks like this:
Server Client
RemoteA ------------>RemoteA(remoteRef)
{ {
clientable state------->clientable state(value)
non-clientable state
} }
in other words, client hold remote object's reference and its some state information simultaneity.
at present almost all distributed program just use RPC, but in our works there are almost simultaneity present, we need not only method invocation but also state data.
what I wonder, why it's impossible?
A hard or complix implementation? -
3. Re: remote object data and behavior
tom.elrod Jan 23, 2005 8:10 PM (in response to xiangya)Ahh. Think I understand now. JBoss Remoting will pass all parameters (and return objects) by value currently. It is certainly possible to either implement your parameter and/or return objects so that they are proxies, so would be passed by reference (without JBoss Remoting's knowledge) or to create a custom marshaller that would convert the parameter/return objects into proxies so that they are passed by reference. However, the ability to convert objects to proxies is not currently available.