3 Replies Latest reply on Jan 23, 2005 8:10 PM by Tom Elrod

    remote object data and behavior

    Xiang Qinxian Newbie

      Hi,
      I can't find somthing about remote object after read jboss-remoting docs
      and check examples.
      Can anyone give me some hint?
      if not or have not, As stated in this message subject entry, can you think of this question.
      In here, remote object refer to some rmi remote object
      but with client-copy simple instance which hold instance data.
      so in client call on remote object, there are two sort of behavior:
      1, do remote call to remote object in client which tranfer to remote object on server side.
      2, do remote call to remote object in client which just handle the same object local.

      I call it for Remote Object Call.

      could talk about this deeply?

        • 1. Re: remote object data and behavior
          Tom Elrod Master

          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
            Xiang Qinxian Newbie

            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 Master

              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.